Repository navigation
fix(agents): agent --local exits silently when the session key has uppercase letters - #196869
Open
scoootscooob wants to merge 3 commits into
Open
scoootscooob wants to merge 3 commits into
scoootscooob wants to merge 3 commits into
Conversation
…percase letters The agent command claims the session turn under the key it was given, while the embedded runner admits its turn under the stored (case-folded) key. Session controller admission matches the owner by exact key, so the runner did not inherit the command's claim and queued behind it. Nothing else kept the event loop alive, so Node exited with code 13 and no output. Claim the turn under the stored key so both layers name the same owner. Co-Authored-By: Claude Fable 5.2 <[email protected]>
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Contributor
|
Codex review: stale review; fresh review needed. Summary Next step Review history (1 earlier review cycle)
|
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Keeps both the mixed-case session key test and main's new ingress admission tests in agent-command.cancellation.test.ts. Co-Authored-By: Claude Fable 5.2 <[email protected]>
This branch has not been deployed
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.
Problem
On main,
openclaw agent --local --session-key <key>exits with code 13 and no output whenever the key contains an uppercase letter (for example a Slack channel id,agent:main:channel:C3TT2OEIAJ7). stderr shows only Node'sWarning: Detected unsettled top-level await at openclaw.mjs. Lowercase keys work. 2026.11.2 and 2026.11.3 are not affected.Repro on c581fe0 (any provider; fails before the first model request):
The Gateway is affected too:
POST /v1/responseswith an uppercasex-openclaw-session-key(for exampleagent:main:channel:C3TT2OEIAJ7) never returns on c581fe0; the Gateway log showsreply watchdog: ... action=warn reason=no_semantic_progress. Theopenclaw agentclient through the Gateway is not affected.Cause
agentCommandInternalclaims the session turn withwithSessionTurnunderprepared.sessionKey, the key as given. The embedded runner then admits its own turn under the stored key (prepareEmbeddedRunSessionreplacessessionKeywithrunSessionTarget.sessionKey, which is case-folded).withSessionTurninherits the ambient owner only whenowner.aliases.has(sessionKey), an exact match, so the runner does not inherit the command's claim. Its target still resolves to the same mailbox through the session-id alias, so it submits a second task behind the claim its own caller holds. Session-controller diagnostics show it:Nothing else keeps the event loop alive, so the process exits.
Loosening the alias match is not enough: with that change alone the run fails later with "Native registration does not match the exact admitted session turn", so exact-key identity is relied on downstream.
Fix
Claim the command's turn under the stored key (
normalizeStoreSessionKey), the same key the runner uses, so both layers name the same owner.Verification
New test in
agent-command.cancellation.test.ts: times out without the change, passes with it.agent-command.cancellation,agent-command.admission-failure,agent-command-localsuites: 36 passed.End to end on a build of c581fe0 with the equivalent change applied to the bundle: 40 multi-turn trials launched with
agent --localand mixed-case keys, 0 failed turns of 110 (56 of 110 failed before), and a second turn on the same key sees the first turn's history.Gateway
/v1/responseswith mixed-case session keys, same patched build: 40 multi-turn trials, 0 failed turns (the unpatched build hangs on the first such turn).Not run locally: the full test suite and the type check. The test adds 18 lines; I can add a
config/test-lines-allocationsentry if you want it kept as a separate test.🤖 Generated with Claude Code