Skip to content

[Feature]: Goal continuance — per-turn goal context + QA continuance scenarios #100409

Description

@steipete

Summary

Goal continuance: keep an active session goal actually driving behavior across turns — QA continuance scenarios plus a bounded continuation nudge when a turn ends without progress on an active goal.

Problem to solve

/goal gives a session one durable objective (docs/tools/goal.md), but persistence of the objective record is not the same as persistence of pursuit. Across many turns — especially after compaction, interruptions, or context-heavy detours — the agent can drop the plan thread: it acknowledges the goal when asked but stops advancing it, or restarts planning from scratch each turn. There is currently no QA coverage that proves multi-turn goal followthrough (short-form or long-form), so regressions in continuance are invisible.

Proposed solution

Two parts, same surface:

  1. Per-turn goal context: when the session has an active goal, include one short goal-context line in the per-turn inbound envelope (the same per-turn seam that carries timestamps/inbound meta — not the system prompt, so prompt-cache prefix bytes are untouched). The model then sees the objective on every turn and after compaction, instead of only when it happens to call get_goal. Paused/blocked/limited/complete goals inject nothing (operator intent is to stop pursuit). No goal-state mutation, no new config surface.
  2. Continuance QA scenarios (qa/scenarios/...): flow scenarios that prove (a) after /goal start, the next inbound turn's agent request carries the goal context; (b) the goal context survives /compact and appears on the following turn; (c) a live-tier followthrough scenario asserting the agent advances the objective on a later turn instead of restarting planning (mirroring the existing instruction-followthrough contract).

Alternatives considered

  • Background/cron-driven goal pursuit: explicitly out of scope — docs/tools/goal.md deliberately separates goals from background tasks/standing orders; this proposal keeps goals session-scoped.
  • Prompt-only fix (bigger goal blurb in system prompt): doesn't survive compaction/detours and can't be regression-tested without the scenarios anyway.
  • Doing nothing: continuance quality remains untested and unmeasured.

Impact

  • Affected: every session using /goal; TUI + all channels.
  • Severity: medium-high — long-running work is the core promise of a session goal.
  • Frequency: any multi-turn goal session; worst after compaction or interruptions.
  • Consequence: silent stalls, operators re-prompting "continue", inconsistent long-form execution.

Evidence

  • Goal surface: src/agents/tools/goal-tools.ts, src/auto-reply/reply/commands-goal.ts, src/config/sessions/goals.ts, docs/tools/goal.md
  • Gap evidence: goal objective is not referenced anywhere in the per-turn context path (src/auto-reply/envelope.ts, src/auto-reply/reply/inbound-meta.ts) nor in compaction; only get_goal, the TUI footer, and the /goal command surface it.
  • Followthrough precedent: qa/scenarios/agents/instruction-followthrough-repo-contract.yaml, src/agents/embedded-agent-runner/run/incomplete-turn.ts

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.enhancementNew feature or requestimpact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.impact:ux-frictionUser-facing flow adds avoidable confusion or support burden without fully blocking progress.issue-rating: 🌊 off-meta tidepoolIssue quality rating does not apply to this item.maintainerMaintainer-authored PR

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions