Skip to content

feat(serve): give serve, ACP, MCP and mission sessions the cora review guidance #536

Closed

Description

@ajianaz

What problem does this solve?

The cora agent-as-reviewer instructions (CORA_REVIEW_SECTION in tole-cli/src/main.rs) are appended to the system prompt only through review_section(&registry), and that function is called from three places: run_command, chat_command and tui_command. A search of session_host.rs, serve.rs, acp.rs and mission.rs finds no use of it: sessions created by tole serve, tole acp and tole mcp build their system prompt from TOLE_SYSTEM_PROMPT alone, and I found no use in the mission path either (not verified end to end).

So the faces used by editors, phones and scripted missions, which is where unattended coding happens, never learn that a review flow exists, even when the cora MCP tools are attached to the registry (to verify: whether the session registry of those faces includes the mcp_cora_* tools at all).

Proposed solution

  • Make the review guidance part of session creation in the shared session host instead of three command functions: whenever the registry holds both mcp_cora_cora_review_prepare and mcp_cora_cora_review_finalize, the pinned system prompt of a new session includes the section. One code path, so a new face cannot forget it (this is also where the session-host extraction in refactor: extract one session-host module from tole-cli (merge Sessions and TuiSession) #525 lands).
  • Pin it in the session header like the rest of the system prompt, so resume keeps the guidance and a later change does not rewrite an old session (append-only rule).
  • Mission mode: include the section and name the review step in the mission prompt's done-criteria text (guidance only; enforcement belongs to the review-gate issue).
  • Keep the existing absent-tools behaviour: no tools, no section, no phantom instruction.

Alternatives considered

  • Leave it per command: already drifted (three faces miss it).
  • Make the section unconditional: it would reference tools that are not there.

Acceptance criteria

  • A session created through serve, acp, mcp and mission with the review tools attached has the section in its pinned system prompt (tests per face).
  • Without the tools, no section (existing test stays green).
  • resume of an older session does not change its pinned prompt.
  • First step: verify and document in the PR which faces actually get mcp_cora_* tools, and fix that gap if there is one.

Related: #525 (session-host extraction), the review-gate issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions