Skip to content

Fix agent runtime concurrency and cancellation handling#633

Merged
bobleer merged 1 commit into
GCWing:mainfrom
bobleer:fix/agent-runtime-concurrency
May 10, 2026
Merged

Fix agent runtime concurrency and cancellation handling#633
bobleer merged 1 commit into
GCWing:mainfrom
bobleer:fix/agent-runtime-concurrency

Conversation

@bobleer
Copy link
Copy Markdown
Collaborator

@bobleer bobleer commented May 10, 2026

Summary

  • Tighten session turn ownership so stale turns cannot overwrite newer processing state during completion, cancellation, or failure cleanup.
  • Register and preserve cancellation tokens early enough for pre-round cancellation, and check cancellation before opening model streams.
  • Avoid DashMap guards across awaits and keep terminal post-command shell state separate from command output.

Test plan

  • cargo test -p bitfun-core cancel_keeps_token_registered_until_cleanup -- --nocapture
  • cargo test -p bitfun-core update_session_state_for_turn_if_processing -- --nocapture
  • cargo check --workspace
  • cargo test --workspace
  • pnpm run lint:web
  • pnpm run type-check:web
  • pnpm --dir src/web-ui run test:run
  • git diff --check

Tighten session turn ownership, cancellation token lifetime, and terminal state handling so stale turns cannot overwrite newer execution state.
@bobleer bobleer merged commit f8b1742 into GCWing:main May 10, 2026
4 checks passed
@bobleer bobleer deleted the fix/agent-runtime-concurrency branch May 11, 2026 02:42
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.

1 participant