Skip to content

feat(overseer): non-Cursor session-summary contract + debug relative dates - #88

Open
heavygee wants to merge 11 commits into
feat/overseer-summary-fallbackfrom
feat/overseer-summary-flavors-and-dates
Open

feat(overseer): non-Cursor session-summary contract + debug relative dates#88
heavygee wants to merge 11 commits into
feat/overseer-summary-fallbackfrom
feat/overseer-summary-flavors-and-dates

Conversation

@heavygee

@heavygee heavygee commented Jul 24, 2026

Copy link
Copy Markdown
Owner

Summary

Stacked on #87. Closes the remaining emission gap for Claude / Codex / Grok / OpenCode (Cursor already covered by the .mdc overlay in #86).

  • Shared sessionSummaryInstruction appended via each flavor's systemPrompt / developer_instructions / one-shot first-turn inject (Grok/OpenCode remote already use instructionsSent - not every user turn).
  • Opt-out: HAPI_SESSION_SUMMARY_CONTRACT=0 (default on for HAPI-managed sessions).
  • Debug Settings events + inbox timestamps: standard "x ago" via formatRelativeTime, absolute datetime in title tooltip (matches Session Log).
  • Design doc updated with opt-in better fallback options (raw OpenAI-compatible API vs oneshot agent) - not implemented yet; prefer Option A first.

Fork-only. No user-turn prepend (tiann#1095/tiann#1096).

Test plan

Made with Cursor

Related

Claude/Codex/Grok/OpenCode now get the same AGENT_NOTIFY_SUMMARY instruction
via systemPrompt / developer_instructions / one-shot first-turn injects (not
user-turn prepend). Opt-out: HAPI_SESSION_SUMMARY_CONTRACT=0.

Also fix debug events/inbox timestamps to use standard relative "x ago" with
absolute datetime tooltips, and document opt-in better-fallback options
(raw OpenAI-compatible API vs oneshot agent) for a later piece.

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


Correct better-fallback design: no input-char caps when LLM path runs (full
turn content for accuracy); rarity gate (<5% miss) is the cost control.
Link fork issue #89 for remaining kimi/pi/generic-ACP emission coverage.

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).

Soup ask (meta): please place feat/overseer-summary-flavors-and-dates after feat/overseer-summary-fallback (layer after emit+fallback). CLI+web change — needs operator hapi-restart-hub + web dist rebuild when you rematerialize.

@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: deafc1daf7

ℹ️ 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 thread cli/src/modules/common/sessionSummaryInstruction.ts Outdated
Comment thread cli/src/grok/utils/systemPrompt.ts Outdated
Comment thread cli/src/opencode/utils/systemPrompt.ts Outdated
Comment thread cli/src/modules/common/sessionSummaryInstruction.ts
Soup rematerialize L14 conflicted because this tip dropped upstream
skill-lookup on grok/opencode while adding session-summary wrap.
Preserve both so next rebuild merges clean without ad-hoc union.

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

Copy link
Copy Markdown
Owner Author

Soup tip hygiene: pushed 62a556f87 — grok/opencode keep upstream SKILL_LOOKUP_INSTRUCTION inside withSessionSummaryInstruction wrap (was dropped in deafc1daf, caused L14 soup union). Rematerialize now takes tip via rerere; L16 still unions with cross-flavor-inline-images (HAPI_MCP_BRIDGE_PROMPT + wrap) by design (that module lands after this layer).

@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: 62a556f87e

ℹ️ 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 thread cli/src/grok/utils/systemPrompt.ts
Co-authored-by: Cursor <cursoragent@cursor.com>
@heavygee

Copy link
Copy Markdown
Owner Author

Better LLM fallback tracking: #90 (peer 82af1ef4-… implementing Option A, default off).

Leave AGENT_NOTIFY_SUMMARY visible via Settings → About when verifying
emission (default still strips). Defer hub-synthesized Session Log
fallback until thinking clears so ACP mid-turn text flushes stop
flooding the log.

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: d8848ff315

ℹ️ 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 thread hub/src/sync/syncEngine.ts Outdated
heavygee and others added 2 commits July 24, 2026 16:44
Session Log should not invent progress crumbs from ACP mid-turn text
flushes. Keep AGENT_NOTIFY_SUMMARY (and rare session-end completed);
leave tool timelines to session-flow experiments.

Co-authored-by: Cursor <cursoragent@cursor.com>
CI failed on missing skillLookupInstruction. Generic flavor prompts no longer
emit <project>/<agent-id> placeholders; hub ignores those tokens. Local Claude/
Codex CLIs and Grok/OpenCode user prepends stay human-facing (tiann#1095/tiann#1096).

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: 53a6dae301

ℹ️ 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 thread cli/src/modules/common/skillLookupInstruction.ts
Comment thread cli/src/modules/common/sessionSummaryInstruction.ts Outdated
Comment thread web/src/lib/assistant-runtime.ts
deriveSessionProject splits on backslash so Windows paths don't poison
project filters. Nested CodexAgent / tool-child text now honors the
show-contract toggle. Grok/OpenCode keep the one-line skill-lookup
prepend (only channel; notify contract stays off).

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

const data = await api.fetchSystemEvents({ limit: 80 }) as SystemEventsResponse
// Hub-inferred silence is no longer written; hide historical `stale`
// rows from this operator-facing debug feed (same rule as Session Log All).
const visible = data.events.filter((event) => event.eventType !== 'stale')
setTotal(visible.length)

P2 Badge Filter stale events before applying the page limit

On upgraded hubs with many historical stale rows among the latest 80 events, fetchSystemEvents({ limit: 80 }) applies the database limit before this client-side filter. Non-stale events beyond that page are therefore omitted, and the debug feed can misleadingly report few or no events even though relevant rows exist. Exclude stale rows in the server query or continue pagination until the requested number of visible rows is collected.

ℹ️ 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 thread web/src/lib/assistant-runtime.ts
Comment thread docs/plans/2026-07-24-overseer-summary-emission.md Outdated
useExternalMessageConverter WeakMap-keys wrappers, so flipping the About
debug toggle must allocate new wrappers. Plan no longer claims Piece 2
synth or Grok/OpenCode first-turn notify coverage.

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

Copy link
Copy Markdown
Owner Author

Re the review-body P2 on EventsDebugControls (filter stale before limit): not changing this. Hub no longer writes stale rows; the client hide is leftover-history only. Paginating a debug dump until 80 non-stale events is YAGNI for this panel.

@heavygee

Copy link
Copy Markdown
Owner Author

@codex review

@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: 341e6d8eea

ℹ️ 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 thread cli/src/modules/common/sessionSummaryInstruction.ts
Comment thread web/src/components/settings/EventsDebugControls.tsx
Models copy "none" or the example "<=12 words" into action; hub treated any
nonempty done-action as operator work. Prompt now says omit action when
nothing remains, and deriveAttentionCandidate drops those sentinels.

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

Copy link
Copy Markdown
Owner Author

@codex review

@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: ad1ee1c80c

ℹ️ 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 thread shared/src/overseerEvents.ts
Comment thread web/src/components/ToolCard/trace.tsx Outdated
blocked/needs_* still need attention, but "none" / "<=12 words" must not
land as inbox next-step text. Subscribe once in TraceChildList instead of
per-row window listeners.

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

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: 2071cbd44e

ℹ️ 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".

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