Skip to content

fix(cli): send the pinned mission system prompt to the provider - #410

Merged
ajianaz merged 1 commit into
developfrom
fix/mission-system-prompt
Oct 18, 2026
Merged

ajianaz merged 1 commit into
developfrom
fix/mission-system-prompt

Conversation

@ajianaz

@ajianaz ajianaz commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

What

tole mission now sends its pinned system prompt (base prompt + MISSION_COMPLETE marker contract + todo discipline) to the model, on fresh runs and on --resume.

Why

Found by the cora 0.19 agent-mode full scan (MAJOR, confirmed; pre-existing on develop). run_mission stored the system prompt in the session header via JsonlStorage::create_with, but built the provider as OpenAiProvider::new(cfg).with_tool_specs(...) and never called with_system_prompt. The scan flagged --resume; reading the code, a fresh mission was affected too — only the first user message's short hint mentioned the marker, and a resumed mission lost even that. run/chat already apply storage.system_prompt() (main.rs).

Changes

  • mission.rs: new mission_provider(cfg, specs, &storage) applies storage.system_prompt() when present; run_mission uses it for both the fresh and the resumed path.

Testing

  • New mission_provider_sends_the_pinned_system_prompt_on_resume: creates a mission session with the real mission_prompt, then checks the request body for the freshly created storage and for the same file reopened via JsonlStorage::open (the resume path) — the first message is system and contains MISSION_COMPLETE_MARKER.
  • cargo fmt --all, cargo clippy --workspace --all-targets -- -D warnings, cargo test --workspace green; cora review --staged: ✅ No issues found.

🤖 Generated with Claude Code

run_mission wrote the mission system prompt (MISSION_COMPLETE marker
contract, todo discipline) into the session header but built the
provider with tool specs only, so the model never saw it — on a fresh
mission or on --resume. Build the provider through mission_provider,
which applies storage.system_prompt() like the run/chat faces do.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions

Copy link
Copy Markdown

🔍 Cora AI Code Review

✅ No issues found. Code looks good!


Review powered by cora-code · BYOK · MIT

@ajianaz
ajianaz merged commit 249b786 into develop Oct 18, 2026
17 checks passed
@ajianaz
ajianaz deleted the fix/mission-system-prompt branch October 18, 2026 04:17
ajianaz added a commit that referenced this pull request Oct 18, 2026
Resolve mission.rs: keep the failover chain build and apply the pinned
system prompt (from #410) to every link via configure_mission_provider.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant