Repository navigation
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
Endpoint auditContract: pinned release artifact
Actionable client-only calls (0)none Actionable server-only operations (18)
Documented non-divergences (13)Client calls intentionally absent from the filtered contract (11)
Reason: Operational Agent Server endpoints intentionally excluded from the filtered public release artifact.
Reason: Client-ahead API stacked on the pending Agent Server meta-profiles implementation.
Reason: Client-ahead API stacked on the pending Agent Server pre-flight LLM validation endpoint. Server operations covered by an exposed browser URL (2)
Reason: RemoteWorkspace.startWorkspaceSession exposes these authenticated URLs for browser iframe and file requests; they are not HttpClient method calls. |
Python API breakage checks — ✅ PASSEDResult: ✅ PASSED |
REST API breakage checks (OpenAPI) — ✅ PASSEDResult: ✅ PASSED |
Coverage Report •
|
||||||||||||||||||||
Summary
Apply Claude Code auto-compaction at 400,000 for managed Claude ACP sessions whose requested model is exactly
claude-sonnet-5-5. The policy is applied to the spawned subprocess environment and is rebuilt on each start, so restarts and resumes re-evaluate it. Haiku, Opus, thesonnetalias, other providers, and other models are unchanged.Design
The SDK sets
CLAUDE_CODE_AUTO_COMPACT_WINDOW=400000after merging inherited and ACP environment values, and only when both the command is Claude and the requested model is the exact Sonnet 5.5 identifier. This keeps the policy scoped to the Claude subprocess, overrides an inherited value for the qualifying model, and leaves access policy, exact-model proof, structured output, persisted settings, and host Claude configuration unchanged.The selected environment variable was statically qualified on the runtime Claude CLI 2.1.293 and bundled Claude Code 2.1.280. Both also contain the
autoCompactWindowsetting surface. No settings file is written.Files changed
AGENTS.md— document the exact-model policy and its lifecycle.openhands-sdk/openhands/sdk/agent/acp_agent.py— apply the environment value to qualifying Claude ACP subprocesses.tests/sdk/agent/test_acp_agent.py— cover model-switch restart behavior.tests/sdk/agent/test_acp_claude_auth_isolation.py— cover model scoping, environment precedence, restart, concurrency, isolation, and credential coexistence.Review and audit
Four review rounds (r1–r4) completed with zero MUST_FIX findings in each review. Four audit rounds completed; audit r4 reported zero MUST_FIX findings. Triage r4 returned OK with no needed changes. Four remediation rounds were used.
Resolved MUST_FIX findings:
claude-sonnet-5-5now schedules a restart, so the new subprocess rebuilds its environment for the requested model. Review and audit r2 marked A1 fixed.load_session. The tests now drive a restart on one conversation state, seed a session ID, and assert that resume callsload_sessionwith that ID while the resumed Sonnet subprocess receives400000. Audit r4 marked O1 fixed.Verification
Focused issue tests passed for auto-compaction, Sonnet 5.5,
SetACPModel, and restart behavior. Scratch ACP verification also passed for the isolation test file and the focused ACP test set; pyright and ruff were clean.The one live Claude probe used CLI 2.1.293 with Sonnet 5.5 and one turn; it returned
ok. The probe did not setCLAUDE_CONFIG_DIRorCLAUDE_CODE_AUTO_COMPACT_WINDOW, so it confirms a bounded session only and does not demonstrate the 400K policy in an isolated config directory. Bundled CLI 2.1.280 was qualified by static inspection. No 400K-reaching run or threshold comparison was performed.MAKE_VALIDATE: rc=0 on 3730d8a (log chain12-validate-try1.log, chain12)
Closes #80