You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(agent-resume): resume Claude sessions at their own effort level - #33765
A resumed Claude terminal session now keeps the effort level it was running at. This covers every resume path: account-switch restart, reboot/cold restore, waking a sleeping pane, and paired-host resumes.
Before this change, Orca only replayed the original launch flags. Claude saves effort as one default per model, so a resume ran at whatever that default was, not the session's own level. Model already behaves this way on resume (Claude reads it from the transcript), so this PR only changes effort.
How
Claude 2.1.133+ sends the live level in hook input (effort.level) on PreToolUse, PostToolUse and Stop. SessionStart and UserPromptSubmit omit it. readPaneProviderSession reads it next to cwd. Both values now share one continuation rule: keep the previous value for the same session, and also across /clear and compact, which restart Claude in the same process. Subagent hooks are ignored because they report their own effort.
It travels on providerSession.effort through the existing normalizer (relay, WSL, SSH) and the saved-workspace schema. The value must be a lowercase token, so it is safe to put in argv.
getAgentResumeArgv emits claude --effort <level> --resume <id>. Claude keeps the last --effort it parses, so a stale --effort in the saved launch args no longer wins. The saved launch recipe itself is unchanged.
recoveryRecordMatches now compares effort, so an effort change in the middle of a turn refreshes the saved record. Session identity (agentProviderSessionsEqual, claims) ignores effort.
Compat: older Claude versions don't send the field, so they keep today's behaviour. ensureAgentSession is strict on older hosts, so effort is sent only to hosts that advertise agent-session.resume-effort.v1.
Verification
Real before/after: hidden dev build (ORCA_BACKGROUND_LAUNCH=1), isolated profile, Claude 2.1.310. Flow: launch Claude, /effort max, run one turn, kill the app and its own daemon, relaunch, cold restore resumes the pane, run one turn. The level comes from the effort Claude records on each transcript line.
resumed command
effort of the resumed turn
main
claude … --resume <id>
medium (the saved default)
this PR
claude … --effort max --resume <id>
max
Tests: hook parse (subagent, omitted field, /clear, a different session), normalize argv safety, saved-workspace round-trip, and the resume command on posix/powershell/cmd with a stale --effort in launch args. I re-ran the cold-restore flow on the final commit with a fresh profile: claude --effort max --resume <id>, and the resumed turn ran at max.
Known limits
Session History resume of a session Orca never saw through hooks still uses Claude's default. Claude does write effort on transcript lines, so a follow-up could read it from there.
The level is learned on the first tool or Stop hook. If a pane was just resumed into a new pane key and is closed again before its first turn finishes, the level falls back to the default.
If a skill or turn sets its own effort, the hooks report that turn's level until the next turn reports the session's level again.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.
Walkthrough
The changes capture Claude effort from hook payloads, validate and store it in provider-session metadata, and include it in resume arguments. Runtime session-ensure paths use an environment-specific adapter that includes effort only when the host supports the resume-effort capability. The changes also update RPC and sleeping-agent schemas, resume-record comparison, and tests for metadata handling and generated resume commands.
Priority: Normal
Merge Risk: Minimal · up to 82a5f
No specific merge-blocking defect is established; merge after normal validation.
Pre-merge checks: 3 · 2
Failed checks: 2 warnings
Check name
Status
Explanation
Resolution
Description check
The description explains the change, implementation, verification, and known limits, but it omits several required template sections, including the linked issue, Visual Proof or an explicit N/A, Testi…
Add the missing template sections. Include an actual issue reference under "Fixes #", state N/A with a reason for Visual Proof if no UI change exists, document the testing platforms and required commands, complete the applicable checkboxe…
Docstring Coverage
Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 15 functions across 16 files.
Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed checks: 3 passed
Check name
Status
Explanation
Title check
The title clearly and concisely describes the primary change: resuming Claude sessions at their saved effort level.
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Description check
Explanation
The description explains the change, implementation, verification, and known limits, but it omits several required template sections, including the linked issue, Visual Proof or an explicit N/A, Testing checklist, AI Disclosure, Review, Notes, Agent skill upstream boundary, and Checklist.
Resolution
Add the missing template sections. Include an actual issue reference under "Fixes #", state N/A with a reason for Visual Proof if no UI change exists, document the testing platforms and required commands, complete the applicable checkboxes, and address AI Disclosure, Review, cross-platform impact, and the Agent skill upstream boundary.
Finishing Touches: 💡 1
📝 Generate docstrings: 💡
Commit to this branch
Create a new PR
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.
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
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.
What
A resumed Claude terminal session now keeps the effort level it was running at. This covers every resume path: account-switch restart, reboot/cold restore, waking a sleeping pane, and paired-host resumes.
Before this change, Orca only replayed the original launch flags. Claude saves effort as one default per model, so a resume ran at whatever that default was, not the session's own level. Model already behaves this way on resume (Claude reads it from the transcript), so this PR only changes effort.
How
effort.level) on PreToolUse, PostToolUse and Stop. SessionStart and UserPromptSubmit omit it.readPaneProviderSessionreads it next tocwd. Both values now share one continuation rule: keep the previous value for the same session, and also across/clearand compact, which restart Claude in the same process. Subagent hooks are ignored because they report their own effort.providerSession.effortthrough the existing normalizer (relay, WSL, SSH) and the saved-workspace schema. The value must be a lowercase token, so it is safe to put in argv.getAgentResumeArgvemitsclaude --effort <level> --resume <id>. Claude keeps the last--effortit parses, so a stale--effortin the saved launch args no longer wins. The saved launch recipe itself is unchanged.recoveryRecordMatchesnow compares effort, so an effort change in the middle of a turn refreshes the saved record. Session identity (agentProviderSessionsEqual, claims) ignores effort.ensureAgentSessionis strict on older hosts, soeffortis sent only to hosts that advertiseagent-session.resume-effort.v1.Verification
Real before/after: hidden dev build (
ORCA_BACKGROUND_LAUNCH=1), isolated profile, Claude 2.1.310. Flow: launch Claude,/effort max, run one turn, kill the app and its own daemon, relaunch, cold restore resumes the pane, run one turn. The level comes from theeffortClaude records on each transcript line.claude … --resume <id>medium(the saved default)claude … --effort max --resume <id>maxTests: hook parse (subagent, omitted field,
/clear, a different session), normalize argv safety, saved-workspace round-trip, and the resume command on posix/powershell/cmd with a stale--effortin launch args. I re-ran the cold-restore flow on the final commit with a fresh profile:claude --effort max --resume <id>, and the resumed turn ran atmax.Known limits
efforton transcript lines, so a follow-up could read it from there.