Skip to content

Generate session titles from a lightweight text transcript - #787

Open
uvforce wants to merge 1 commit into
agegr:mainfrom
uvforce:pr/session-title-transcript
Open

Generate session titles from a lightweight text transcript#787
uvforce wants to merge 1 commit into
agegr:mainfrom
uvforce:pr/session-title-transcript

Conversation

@uvforce

@uvforce uvforce commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Problem

Generating a short session title currently replays the source system prompt, tool schemas, and conversation history, including tool results and reasoning. Tool-heavy sessions can therefore send substantially more context than is useful for naming.

Change

The temporary title agent receives a short naming system prompt, no tools, and one user message containing a plain-text transcript followed by the existing title instructions. This transcript is extracted locally; there is no extra summarization-model call.

The transcript keeps messages in order and includes:

  • Up to 800 Unicode code points from each nonempty user message.
  • Up to 300 code points from each nonempty assistant text message, or 600 for the last nonempty assistant text message.
  • Up to 600 code points from each compaction summary.

Tool calls, tool results, thinking blocks, images, and other message roles are omitted. All user turns with text remain represented, including changes of goal in the middle of a session. The obsolete shadow-tool, tool-pair sanitization, and trailing-user folding helpers are removed.

Scope and relationship to #776

Related to #671. This PR is based directly on main and does not depend on #776 (dedicated title model selection). It changes the input, not the choice of model or thinking level. Both changes are complementary, but they touch the same implementation file and may need reconciliation when one lands.

The manual trigger, waitForIdle(), inherited model and thinking level, transport/credential hooks, 90-second generation timeout, title cleanup, usage reporting, and persistence route are unchanged. This PR does not add first-message automatic naming or any settings/UI changes.

Trade-offs

The caps are heuristics, not a fixed total context or token budget: input still grows with the number of messages. Truncation can cut mid-sentence, and information present only in omitted tool/image content or after a cap is unavailable to the title model. The shorter prompt also stops deliberately matching the source conversation's cache prefix; this is not a claim of lower billed cost or latency for every provider/cache state. Custom conversion/context/payload hooks remain inherited as before.

Validation

  • The focused tests failed against the original implementation and now pass (9 tests).
  • Provider-boundary tests use the real temporary Agent and SDK conversion with a synthetic streaming provider. They verify a single user request, absence of source-system/tool/image/thinking sentinels, source-message immutability, preserved model/transport choices, compaction-only history, unchanged idle waiting, Unicode caps and mid-session goals, usage reporting, and provider errors.
  • Full npm test: 973 passed.
  • TypeScript, ESLint, git diff --check, and production build passed.
  • No live-provider quality/latency benchmark or browser end-to-end test was run for this isolated PR branch. No production session or settings were modified.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 10, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-10T00:47:42.925243Z 092699b PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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