Skip to content

feat(overseer): hub-owned converse context from convo_turns - #106

Open
heavygee wants to merge 4 commits into
feat/overseer-relay-pingfrom
feat/overseer-converse-context
Open

feat(overseer): hub-owned converse context from convo_turns#106
heavygee wants to merge 4 commits into
feat/overseer-relay-pingfrom
feat/overseer-converse-context

Conversation

@heavygee

@heavygee heavygee commented Aug 1, 2026

Copy link
Copy Markdown
Owner

Stacked on #104 (relay-ping / prefix fix). Review/merge after it.

Summary

  • Hub assembles budgeted prior convo_turn history on every POST /overseer/converse and keeps only the latest operator line from the client (transports no longer own the thread).
  • GET /overseer/converse/recent for talk-to / voice hydrate after reload.
  • Talk-to panel hydrates on open and sends only the new utterance.
  • No new chat DB / summarize engine — disposition tombstones stay via existing query_dispositions.

Fixes #105.

Test plan

Issues

Fixes #105

Made with Cursor

heavygee added a commit that referenced this pull request Aug 1, 2026
Hub-owned converse context from convo_turns + GET /converse/recent + talk-to
hydrate so /overseer hard-reload keeps the thread. Tip 5097bcc on #104
(cfafd32 prefix fix included).

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: 5097bcca66

ℹ️ 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/web/routes/overseer.ts Outdated
Comment thread hub/src/web/routes/overseer.ts
Comment thread web/src/components/settings/OverseerChatDebugControls.tsx
Comment thread web/src/components/settings/OverseerChatDebugControls.tsx Outdated
Comment thread hub/src/overseer/converseContext.ts Outdated
Comment thread hub/src/overseer/converseContext.ts Outdated

@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: 98ee43d13b

ℹ️ 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/components/settings/OverseerChatDebugControls.tsx
Comment thread hub/src/overseer/converseContext.ts

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

ℹ️ 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/components/settings/OverseerChatDebugControls.tsx
Comment thread hub/src/overseer/converseContext.ts Outdated
@heavygee

heavygee commented Aug 1, 2026

Copy link
Copy Markdown
Owner Author

Addressed remaining Codex P2s in d3770d5b:

  1. In-flight turn on panel reopen — hydrate effect skips while loading; re-syncs from hub after converse completes (OverseerChatDebugControls.test.tsx).
  2. Turn orderingsortConvoTurnsChronologically orders by ts then id (covers backfilled /convo-turns with custom ts).
  3. Offline exchangespersistOverseerConvoExchange records user-visible replies on unconfigured-brain and BrainUnavailableError paths (route test).
  4. Deduped operator — assembler returns completeDanglingTurnId; route calls completeConvoTurn to fill overseer reply on the existing row instead of inserting a duplicate operator line.

Hub: 39 pass (converseContext, overseer routes, overseerEntity). Web: OverseerChatDebugControls test pass. bun typecheck clean.

@heavygee
heavygee force-pushed the feat/overseer-relay-ping branch from e62cb17 to 55ca5c5 Compare August 1, 2026 20:09
@heavygee
heavygee force-pushed the feat/overseer-converse-context branch from d3770d5 to 99e4b40 Compare August 1, 2026 20:10
@heavygee
heavygee force-pushed the feat/overseer-relay-ping branch from 55ca5c5 to 284c12c Compare August 1, 2026 20:12
@heavygee
heavygee force-pushed the feat/overseer-converse-context branch from 99e4b40 to 4a76baa Compare August 1, 2026 20:12

@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: 4a76baaf09

ℹ️ 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 +111 to +114
const events = overseer.queryEvents({
eventType: OVERSEER_CONVO_TURN_EVENT_TYPE,
limit: limit + 1
})

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 Select recent turns by timestamp before limiting

When more than limit + 1 turns exist and /overseer/convo-turns receives a delayed or backfilled ts, this still asks queryEvents for an ID-ordered limited window and only sorts that subset afterward. A late-inserted old turn can therefore displace a genuinely newer turn from hydration and brain context. Fresh evidence beyond the resolved thread is that queryEvents still executes ORDER BY id DESC LIMIT ?; query the window by ts DESC, id DESC before reversing it.

Useful? React with 👍 / 👎.

})
}
}
setTurns(next)

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 Preserve operator text after a rejected request

When overseerConverse rejects with a network error or a non-BrainUnavailableError server failure, finally clears loading, which reruns this hydration effect; because that failed exchange was not persisted, setTurns(next) removes the locally appended operator message while the input was already cleared. The operator consequently loses the question they may need to retry or copy. Refresh only after an acknowledged response, or retain/restore the failed operator text when merging the snapshot.

Useful? React with 👍 / 👎.

@heavygee
heavygee force-pushed the feat/overseer-relay-ping branch from caff271 to b3465a9 Compare August 1, 2026 23:37
heavygee and others added 3 commits August 2, 2026 00:37
Assemble budgeted prior convo_turn history on every converse call so
text/voice transports stop restarting cold. Add GET /converse/recent for
talk-to hydrate; UI sends only the latest operator line. Fixes #105.

Co-authored-by: Cursor <cursoragent@cursor.com>
- Rehydrate talk-to on every panel open; block send until hydrate settles
- Report truncated when store query clips older turns (limit+1 probe)
- Dedupe dangling operator retry after a completed pair without the
  broken preceding-role check
- Skip hub rehydrate while converse is in flight; re-sync after reply
- Sort hydrated convo_turn window by ts (id tie-break), not id-only reverse
- Persist offline/unconfigured brain replies via recordConvoTurn on the route
- Complete dangling operator rows via completeConvoTurn when assembler dedupes

Co-authored-by: Cursor <cursoragent@cursor.com>
@heavygee
heavygee force-pushed the feat/overseer-converse-context branch from 1949d77 to 0ef4d51 Compare August 1, 2026 23:38
@heavygee

heavygee commented Aug 1, 2026

Copy link
Copy Markdown
Owner Author

Rebased onto #104. Tip 0ef4d512b includes snooze CI fix + #104 P1s + namespace scoping. Meta: please remat soup to this tip when free — do not soup from this session.

Co-authored-by: Cursor <cursoragent@cursor.com>
heavygee added a commit that referenced this pull request Aug 3, 2026
Point tip comments at dispositions b18370b, admin-console 8b9c5d5,
relay-ping 284c12c, converse-context 4a76baa (PR #106 soup tip).

Co-authored-by: Cursor <cursoragent@cursor.com>
heavygee added a commit that referenced this pull request Aug 3, 2026
Operator remat request for 0ef4d51; soup current PR tip 109fe19
(includes that commit + routes brace fix). Also #102/#103/#104 tip
rewrites: snooze CI, bound write grants, #107 per-ns OverseerEntity.

Co-authored-by: Cursor <cursoragent@cursor.com>
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