Skip to content

fix(runtime-host): add numbered suffixes to branch session titles - #4994

Open
sunrioa wants to merge 2 commits into
apache:mainfrom
sunrioa:codex/fix-branch-title-suffix
Open

fix(runtime-host): add numbered suffixes to branch session titles#4994
sunrioa wants to merge 2 commits into
apache:mainfrom
sunrioa:codex/fix-branch-title-suffix

Conversation

@sunrioa

@sunrioa sunrioa commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #4978

Ordinary session branches currently inherit the source title, making them difficult to distinguish in the session list.

This change:

  • Assigns the first available numbered title, such as Review project (1) and Review project (2).
  • Avoids stacking generated suffixes when branching from an existing branch.
  • Preserves manually assigned titles, including numeric endings such as Sprint (2026).
  • Accounts for existing session titles, including archived sessions.
  • Reserves names across concurrent branch creation requests and respects the session title's Unicode code-point limit.
  • Preserves existing naming behavior for source sessions, revisions, and side conversations.

Before

Before: indistinguishable session titles

After

After: numbered branch session titles

Verification

Passed:

  • Build, lint, formatting, typecheck, and Desktop/UI unused-code checks.
  • All 552 script tests.
  • All 33 Electron end-to-end tests.
  • CLI packaging and offline installation smoke tests.
  • Production dependency audit: no vulnerabilities reported.
  • Relevant architecture, release-contract, license-header, locale, and protocol checks.
  • Manual testing of the branch naming behavior by the author.

Known validation limitations

The complete local validation was not entirely green. Intermittent Host process-exit failures occurred in:

  • an invocation-owned detached Host retires after launcher natural exit
  • an authority-supervised Candidate exits if its launch owner is killed
  • owned Host exits promptly after its first connection closes

Issue #4776 tracks the latter two tests, with test-side lifecycle changes proposed in #4814. Additional investigation captured a pending TLS connection from the startup model-metadata refresh remaining alive after host.closed resolved; see the diagnostic comment. This explains the instrumented authority-supervised failure, but has not been confirmed as the cause of every reported failure. The first test also failed on unmodified main and is not explicitly listed in #4776.

Three independent worktrees were created with fresh dependency installations and rebuilt artifacts:

Version Full Host suite
Original base: 2dd98419a 1781 passed, 12 skipped
Original base with this patch 1782 passed, 1 failed, 12 skipped
Unmodified main: f4abd4918 1790 passed, 12 skipped

Five additional rounds of the three lifecycle tests reproduced all three failure types on unmodified main.

AI use

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope: OpenAI Codex assisted with implementation, regression tests, ablation experiments, and validation. The author manually tested the user-visible behavior.

Checklist

  • Tests cover the change and fail without it
  • Lint, format, typecheck and the affected suites pass locally

Static checks and branch-specific tests pass. The complete Host suite encountered the intermittent failures documented above.

Does this PR entail a change in behavior?

  • Yes — described under Summary above
  • No

Assign collision-aware numbered names to ordinary branches, preserve literal manual titles, and cover concurrent creation and durable retries.

Generated-by: OpenAI Codex

@me2seeks me2seeks left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Automated review by OpenAI Codex, operated by me2seeks, at 20f83123b2e5a53f37bb76abaf57e7c7aad741f3. This is not an independent human review.

One P2 compatibility finding: the suffix-stripping heuristic cannot distinguish a new generated branch suffix from an inherited title in an existing branch. See the inline exact-source reproduction.

  1. Optimal for the actual problem: mostly; naming is correctly owned by the Host and cross-source branch reservations are serialized, but existing branch title provenance is misclassified.
  2. Production code that can be deleted: no closed deletion candidate. Do not repurpose titleIsManual as proof that a numbered suffix was generated by this feature.
  3. Low-quality tests that can be deleted or replaced: none identified. Current numeric-title coverage uses manual names and misses persisted branches with auto-generated literal numeric endings.
  4. Deeper refactor: no broad refactor; remove a suffix only when its generated provenance is established, preserving ambiguous existing names.
  5. Ready to merge: no, pending correction of the existing-data naming case.
  6. Residual risks / verification: read all three changed files, branch/revision/side-conversation construction, idempotent retries and stored title-update semantics; executed the exact nextBranchName function on a valid legacy header shape. Full Host branch integration suites were not run locally. User-visible title behavior and persisted metadata are affected; material protected-area changes require independent human review under CONTRIBUTING.md.

Comment thread packages/runtime-host/src/server/session-revision-coordinator.ts Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/M Under 500 readable lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(desktop): distinguish branched conversations with numbered title suffixes

2 participants