Allocate best-effort titles for forked sessions - #1605
Merged
Conversation
Assign compact title suffixes to forked sessions. Preserve title namespaces across nested forks and compatible renames. Serialize concurrent allocations within a runtime.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Assign compact
base title (N)suffixes to forked sessions instead of reusing the source title.Fixes #1596
Type and Areas
Type:
Bug fix
Areas:
Rust core, web UI
Motivation / Impact
Forked sessions previously reused the source title. New forks now select the next available suffix across the workspace, so nested forks remain
title (N)rather than accumulating suffixes.A renamed branch retains its inherited namespace only while its current title matches
base title (N). Otherwise, its current title starts a new namespace.Verification
pnpm run fmt:rspnpm run type-check:webcargo test -p bitfun-services-core branch_lineage --lib -j 1cargo test -p bitfun-core branch_session --lib -j 1cargo test -p bitfun-core concurrent_branches_allocate_distinct_workspace_title_ordinals --lib -j 1git diff --checkgit diff --cached --checkAll passed.
Reviewer Notes
Title allocation is best-effort.
The in-process lock serializes concurrent forks within one runtime instance using the same workspace-path form. Duplicate titles can still occur when separate processes, such as the desktop app and CLI, fork sessions in the same workspace during the same allocation window. The same limitation applies if one in-process caller uses the logical workspace root while another uses the resolved sessions directory.
Existing sessions without
forkOrigin.baseTitleuse their current title as the base on their next fork.Checklist