Skip to content

Allocate best-effort titles for forked sessions - #1605

Merged
wsp1911 merged 1 commit into
GCWing:mainfrom
wsp1911:dev
Jul 18, 2026
Merged

Allocate best-effort titles for forked sessions#1605
wsp1911 merged 1 commit into
GCWing:mainfrom
wsp1911:dev

Conversation

@wsp1911

@wsp1911 wsp1911 commented Jul 18, 2026

Copy link
Copy Markdown
Collaborator

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:rs
  • pnpm run type-check:web
  • cargo test -p bitfun-services-core branch_lineage --lib -j 1
  • cargo test -p bitfun-core branch_session --lib -j 1
  • cargo test -p bitfun-core concurrent_branches_allocate_distinct_workspace_title_ordinals --lib -j 1
  • git diff --check
  • git diff --cached --check

All 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.baseTitle use their current title as the base on their next fork.

Checklist

  • This PR is focused and does not include secrets, temporary prompts, generated scratch files, or unrelated artifacts.
  • Relevant verification is recorded above.
  • User-facing strings, docs, and locales are unchanged.

Assign compact title suffixes to forked sessions.

Preserve title namespaces across nested forks and compatible renames.
Serialize concurrent allocations within a runtime.
@wsp1911
wsp1911 merged commit 7214527 into GCWing:main Jul 18, 2026
5 checks passed
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.

[Bug]: fork分支的标题和原来的一致,应该加一个后缀做标识例如fork1等做区分

1 participant