Skip to content

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

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

sunrioa wants to merge 4 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

Latest main sync

Synced main at d2e1be5 in commit 19864ab to include the upstream Windows inventory fix and trigger fresh CI. Windows inventory now passes (91 declarations). The PR remains a six-file feature change. Normal commit hooks passed without a bypass for this sync.

Fresh root dependency installation, build:test, full build, lint, format, all-workspace typecheck, Desktop/UI Knip, strict-base architecture, other source checks and 196 release-contract tests passed. All ten affected workspaces passed with workspace concurrency 1 and unchanged default internal test commands: Runtime 3,469; Host 1,915; Desktop 2,572; Storage 1,244; CLI 972; Core 833; UI 431; MCP 250; Eval Node 82; Computer use 117. Existing skips remain; Eval Python also passed. No workspace failed or needed a retry in this run.

Supplemental CI scripts: 251 passed; the Biome large-file fixture stalled locally and was interrupted, so that test is not claimed as passing. No assertions or timeouts were changed. Full Electron E2E and package-install smoke were not repeated in this sync-only follow-up; their earlier results below remain historical. Fresh CI is required for the updated merge result.

Earlier validation and historical limitations

Merged main at c08626bf2e641a6dbe9b6d299203441ae54dd6ba. The only conflict was adjacent Storage test additions; both branch-title provenance and upstream tool-mode persistence coverage were retained. The net PR still changes six files.

Validation on macOS arm64, Node 24.19.0, npm 11.19.0, after fresh root dependency installation and rebuilt artifacts:

  • All CONTRIBUTING.md pre-push commands passed: lint, format check, full build, all-workspace typecheck, and Desktop/UI Knip. build:test also passed.
  • CI-selected architecture, inventory, theme, header, locale and TUI checks passed; 70 guard tests and 196 release-contract tests passed.
  • Core 833, Storage 1,244, MCP 250, Computer use 117, UI 421 and Desktop 2,525 tests passed. Eval: Node 82 passed/1 skipped; Python 82 total/12 skipped, successful.
  • Complete Runtime Host default suite: 1,912 passed, zero failed, 12 skipped, including branch naming and two-client UDS regressions.
  • Runtime and CLI complete isolated default reruns: 3,469 and 972 passed respectively, zero failed; first-run failures are documented below.
  • Complete current Electron E2E: 33 passed, 1 failed (34 total); failure documented below.
  • CLI release package and offline smoke passed, including native modules, TUI, controlled filesystem-backed model turn, npx durable-schedule recovery and managed Host lifecycle.

Known validation limitations

The first CI run on the new merge-resolution head failed at Windows test inventory. The branch itself passes npm run windows:inventory (90 declarations). CI merges it with newer main 5049ffc1a; an independent clean worktree at that unmodified main also fails windows-test-inventory.mjs --check. This is an upstream inventory regression introduced after the validated merge base, not an unresolved PR conflict. No unrelated inventory fix was added here.

The initial standard-workspace batch used CI's concurrency 3 and was not entirely green. Runtime failed still preempts compute while a host tool is pending and a queued mutation receives the pre-replacement identity captured at lock acquisition; CLI failed marks an inherited running Bash card detached after rewind (250ms predicate wait). Both complete workspace suites subsequently passed when run individually with their original default test commands. No assertions, sleeps, retries, or timeouts were changed to obtain these results.

Linux-required sandbox smoke, Docker live Eval egress, and cross-platform checks were not run on this macOS host; CI remains required.

The extra complete Electron run failed archived-only history boots into a usable new task with has a live derived effect, the same failure signature addressed independently in #5022. This PR does not change the archive spec, E2E title dependency, or Session-effect coordinator relative to main. #5022 was not folded into this branch, and the E2E failure is not counted as a pass.

The merge-staged protocol guard flags an upstream compatibility declaration pinned to epoch 143 while main is at 147. The full staged Biome sweep also stalled on an unchanged upstream test; direct checking of that file passed. Both files are byte-identical to main. All six net-PR staged blobs pass Biome roundtrip checks; staged ASF/whitespace checks and the protocol check against incoming main pass. Hooks were disabled only for the merge commit after these checks; upstream files and persistent hook configuration were not modified.

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. OpenAI Codex also resolved the merge conflict and ran the current validation; the merge commit includes a Generated-by trailer.

Checklist

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

Contributor checks and branch-specific tests pass. First-run timing failures and the independent archive E2E failure are 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
Preserve both branch-title provenance and upstream tool-mode persistence regressions. Revalidate all affected workspaces, contributor checks, Electron E2E, and CLI packaging; document initial timing failures and the independent archive E2E failure.

Generated-by: OpenAI Codex
Include the upstream Windows inventory correction and revalidate contributor checks and all ten affected workspaces. Preserve the six-file branch naming change.

Generated-by: OpenAI Codex
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