Skip to content

Release the replaced Orchestrator handle - #1610

Merged
DoodleBears merged 3 commits into
mainfrom
claude/project-thread-rqw5f9
Oct 13, 2026
Merged

DoodleBears merged 3 commits into
mainfrom
claude/project-thread-rqw5f9

Conversation

@DoodleBears

Copy link
Copy Markdown
Contributor

Requested by Vain

Before: when a Bot moved to a new Orchestrator Session (for example after the old one was archived), BotHarness kept the Agent handle for the old Session in memory until the Bot stopped or DSH restarted. Every replacement added one more handle.

After: the old handle is released when the Bot moves to the new Session. A Session that is still running a turn is left alone.

How: BotAgentAdapter gains an optional releaseSession(sessionId). The DSH adapter disposes the handle and its per-session state, and skips the call when that Session has an active run. #ensureOrchestrator calls it for every Orchestrator root of the Bot other than the current one. Release failures only log a warning.

Tests: bot-runtime.test.ts checks that the archived Session is released after the replacement and that the current one never is. dsh-bot-agent-adapter.test.ts checks release, idempotence, unknown ids, and that a running Session is kept.

Issue: #1567

🤖 Generated with Claude Code

https://claude.ai/code/session_01Kb59UWGNphSuRtR8QUbxJW


Generated by Claude Code

When a Bot moves to a new Orchestrator Session, the adapter kept the Agent
handle for the replaced Session until the Bot stopped. The runtime now asks
the adapter to release every non-current Orchestrator handle that is not
running.

Issue: #1567
Agent-Task: claude/cloud/session_01Kb59UWGNphSuRtR8QUbxJW
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kb59UWGNphSuRtR8QUbxJW
@DoodleBears DoodleBears self-assigned this Oct 13, 2026
@coderabbitai

coderabbitai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 18 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2b70e4ea-e27f-405c-90a9-d1ed024ea679
📥 Commits

Reviewing files that changed from the base of the PR and between be7fb07 and 58e98c9.

📒 Files selected for processing: 5
  • changes/1567-release-replaced-orchestrator.md
  • packages/core/src/runtime/bot-runtime.ts
  • packages/core/src/runtime/dsh-bot-agent-adapter.ts
  • packages/core/test/bot-runtime.test.ts
  • packages/core/test/dsh-bot-agent-adapter.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@DoodleBears
DoodleBears marked this pull request as ready for review October 13, 2026 18:34
Main carries two ADR-0194 records (#1596 and #1597), which fails the ADR
number check. This ports the same renumbering as #1607 so CI can pass.

Issue: #1567
Agent-Task: claude/cloud/session_01Kb59UWGNphSuRtR8QUbxJW
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kb59UWGNphSuRtR8QUbxJW

Copy link
Copy Markdown
Contributor Author

The lint, format, typecheck, test, build, docs check failed on the ADR number check, not on this change. main currently carries two ADR-0194 records (from #1596 and #1597), so check-adr-numbers fails on main as well. I ported the same renumbering that #1607 makes (the MCP secrets ADR becomes 0195 and its four links are updated) in fa041f5. That commit has no effect once #1607 lands.


Generated by Claude Code

…-rqw5f9

# Conflicts:
#	CHANGELOG.md
#	CHANGELOG.zh.md
#	docs/dev/guides/private-input-ordinary.md
#	docs/dev/guides/private-input-ordinary.zh.md
@DoodleBears
DoodleBears merged commit 76d262a into main Oct 13, 2026
2 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.

2 participants