Skip to content

fix(sessions): keep auto-rename bound to the active Codex transcript - #753

Merged
im-ian merged 1 commit into
mainfrom
fix/codex-auto-title-session-binding
Aug 5, 2026
Merged

fix(sessions): keep auto-rename bound to the active Codex transcript#753
im-ian merged 1 commit into
mainfrom
fix/codex-auto-title-session-binding

Conversation

@im-ian

@im-ian im-ian commented Aug 5, 2026

Copy link
Copy Markdown
Owner

Summary

Keep generated Acorn session names attached to the Codex conversation that supplied their transcript, including CLI restarts and /new rotations.

  1. Authoritative hook binding — Persist accepted owner hook UUIDs for Claude and Codex as the active provider marker. Child and malformed identifiers remain rejected.
  2. Scanner arbitration — Protect a provider-declared marker for the existing transcript dormancy window so cwd/mtime inference cannot immediately restore the abandoned conversation.
  3. Stale generation fence — Re-resolve title input after the AI call and store the generated name only when the transcript ID still matches.
  4. Regression coverage — Cover provider ownership filtering, Claude/Codex marker replacement, inference rollback, and stale title results.

Expected impact

Scenario Before After
Restart Codex in the same Acorn session A previous transcript could win the cwd/mtime scan and supply the title The accepted owner hook binds the new Codex transcript directly
Run /new inside Codex The abandoned transcript could overwrite the new marker during the handoff The new provider marker stays authoritative through the ambiguity window
Transcript rotates during title generation An in-flight title could be stored for the no-longer-current transcript The stale result is skipped after transcript revalidation

Design notes

  • Marker writes happen only after the hook reducer accepts an event, and only owner-scoped Claude or Codex events with UUID provider session IDs qualify.
  • The provider marker lease uses the same 10-second dormancy interval as transcript arbitration. Provider hooks can still replace it immediately, while inferred writers resume normal arbitration afterward.
  • Title generation records the resolved transcript ID, repeats resolution after the potentially slow AI call, and updates the session only when both IDs match.

Test plan

  • cargo test -p acorn --lib -- --test-threads=1 — 719 passed, 1 ignored
  • pnpm exec vitest run src/lib/sessionTitle.test.ts src/store.test.ts — 2 files, 185 tests passed
  • pnpm run typecheck passes
  • rustfmt --edition 2021 --config skip_children=true --check src/lib.rs src/commands.rs src/agent_resume_persister.rs passes
  • cargo clippy -p acorn --lib --tests exits successfully
  • git diff --check origin/main...HEAD passes

Notes

  • Rust 1.95 Clippy still reports existing warnings in unrelated code; this PR introduces no new Clippy warning.

@im-ian im-ian added the fix Bug fix label Aug 5, 2026
@im-ian
im-ian merged commit 5ffe1fa into main Aug 5, 2026
3 checks passed
@im-ian
im-ian deleted the fix/codex-auto-title-session-binding branch August 5, 2026 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant