Skip to content

feat(overseer): deterministic per-turn fallback when no summary line (Half B, piece 2) - #87

Open
heavygee wants to merge 1 commit into
feat/overseer-summary-emitfrom
feat/overseer-summary-fallback
Open

feat(overseer): deterministic per-turn fallback when no summary line (Half B, piece 2)#87
heavygee wants to merge 1 commit into
feat/overseer-summary-emitfrom
feat/overseer-summary-fallback

Conversation

@heavygee

Copy link
Copy Markdown
Owner

Summary

Stacked on #86. The Cursor rule overlay boosts AGENT_NOTIFY_SUMMARY emission, but no rule can force an LLM to 100% always end with the line. This adds a deterministic hub backstop so the overseer never has a fully blind agent turn.

When an agent turn produces visible assistant text but extractNotifySummary() returns null (and it is not an empty-sentinel / malformed-line / tool-failure case), overseerEventRecorder synthesizes a minimal progress event from the first non-empty line of the text.

  • No LLM (operator rejected the clunky summarizer for v1).
  • attentionCandidate: 0 - Session Log only, never the attention inbox.
  • provenance: hub-synthesized ... - never mistaken for a real self-report; idempotent per messageId.
  • Precedence: notify > validation_error > tool_failure > this fallback.
  • First line capped at 200 chars with an ellipsis.

Fork-only overseer work - never upstream.

Test plan

Made with Cursor

Rule compliance can never be 100% (an LLM may drop the trailing
AGENT_NOTIFY_SUMMARY line), so add a deterministic hub backstop: when an agent
turn produces visible assistant text but no parseable summary, synthesize a
minimal progress event from the first non-empty line. No LLM.

- attentionCandidate 0: lands in the Session Log only, never the attention inbox.
- provenance marks it hub-synthesized so it is never counted as a real
  self-report; idempotent per messageId.
- ordering: notify > validation_error > tool_failure > this fallback.

Guarantees the overseer never has a fully blind agent turn even when the Cursor
rule overlay's line is dropped. Fork-only overseer work.

Co-authored-by: Cursor <cursoragent@cursor.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: db755c7237

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +244 to +245
if (!primary && plainText) {
primary = this.synthesizeTurnFallback(session, messageId, plainText, ts)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Defer fallback until the turn is complete

When an ACP-backed agent emits text before a tool call, AcpMessageHandler flushes that text as its own message before the final turn text (cli/src/agent/backends/acp/AcpMessageHandler.ts:613-620). This branch records a synthetic progress event immediately for that pre-tool segment, so even a compliant turn that later ends with a real AGENT_NOTIFY_SUMMARY still gets extra hub-synthesized progress rows in the session log/overseer memory. Please defer the fallback until a turn boundary or otherwise suppress it for non-final text segments.

Useful? React with 👍 / 👎.

Comment on lines +244 to +245
if (!primary && plainText) {
primary = this.synthesizeTurnFallback(session, messageId, plainText, ts)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep corrupted malformed summaries out of fallback

When Cursor applies the known AGENT_NOTIFY_SUMMARYAGENT_NOTIFY_SUMARY corruption but the JSON is malformed, extractNotifySummary() returns null and the existing malformed-line detector does not match the corrupted token, so this fallback records the turn as ordinary progress instead of preserving the validation error precedence described for malformed summary lines. Please guard the fallback against any last-line notify token variant that collapse-matches the canonical token but fails to parse.

Useful? React with 👍 / 👎.

heavygee added a commit that referenced this pull request Jul 24, 2026
…nvisible

Half-B overseer emission (fork-only, PR #86/#87, do NOT upstream), stacked:
emit (CLI, 9ef0242) then fallback (hub-only, db755c7), inserted after
feat/overseer-contract-invisible per peer request. Not yet activated —
blocked behind the v0.23.4 upstream bump sweep (fork main 23 behind); layers
will land on the fresh base during that rematerialize + hub restart.

Co-authored-by: Cursor <cursoragent@cursor.com>
@heavygee

Copy link
Copy Markdown
Owner Author

Tracking: remaining flavor coverage (kimi / pi / generic ACP) is fork issue #89 — needed for next overseer phase full-fleet primary emission.

Design doc: docs/plans/2026-07-24-overseer-summary-emission.md (better-fallback corrected: rarity gate first, full-turn content when LLM path runs — no quality-degrading char caps).

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