39efad89a8
Deduplicates the sidecar handling across 9 sites: - substitute_api_content(): 2 API-bound pop+substitute sites (chat_completion_helpers, transport — conversation_loop keeps its inline pop because the current-turn compose fallback needs the value) - drop_stale_api_content(): 4 rewrite-drop sites (context_compressor x2, replay_cleanup, agent_runtime_helpers) - extract_api_content_sidecar(): 3 gateway forwarding sites (gateway/session, gateway/slash_commands, cli_commands_mixin) Also: restore the eager _pending_cli_user_message clear on the early row-creation try (was lost when the crash-persist moved after prefetch — a crash in compression between the two tries would leave a stale staged input), and fix a comment indentation nit in run_agent.py. Co-authored-by: Soju06 <qlskssk@gmail.com>