fix: handle -32601/-32602 in session/load fallback#174
fix: handle -32601/-32602 in session/load fallback#174Bortlesboat wants to merge 1 commit intoopenclaw:mainfrom
Conversation
When an ACP agent returns JSON-RPC -32601 (Method not found) or -32602 (Invalid params) during session/load, acpx now gracefully falls back to session/new instead of crashing. These codes indicate the agent does not properly support session/load (e.g. cursor-agent) and should trigger fallback unconditionally, regardless of whether the session already has agent messages. The extractAcpError() call is also hoisted above the sessionHasAgentMessages guard to avoid redundant extraction. Closes openclaw#152
|
doing some testing with some automated workflows on this PR, fyi |
Triage resultQuick read
Intent
Why
Codex review
CI/CD
Recommendation🏁 escalate to a human |
Triage resultQuick read
IntentMake persistent Why
Codex review
CI/CD
Recommendation🏁 escalate to a human A maintainer should decide whether the current behavior is the desired compatibility policy: if |
Summary
shouldFallbackToNewSession()now handles JSON-RPC-32601(Method not found) and-32602(Invalid params) unconditionally, falling back tosession/newinstead of crashingsession/load(e.g., cursor-agent returns-32602), so fallback should happen regardless of whether the session has prior agent messagesextractAcpError()call is hoisted above thesessionHasAgentMessagesguard to cache the result and avoid redundant extractionTest plan
-32602with agent messages triggers fallback (was crashing before)-32601with agent messages triggers fallback-32603behavior unchanged (still gated behindsessionHasAgentMessages)tsc --noEmit,oxlint,oxfmtcleanCloses #152