Repository navigation
Conversation
|
📁 PR Artifacts Notice This PR contains a |
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 •
|
||||||||||||||||||||
AGENT:
Implemented through the multi-agent pipeline (Sonnet design/review/triage, gpt-6-luna implementation, gpt-6.1-sol audit). Evidence from the live ai-dev-workflow-go runtime (Cursor ACP, Grok 4.7 medium non-fast): 3 of ~20 read_only
asksetups failed withACPSessionModeError: ... did not confirm read_only session mode 'ask' (advertised current='agent', observed=None)(2026-10-04 15:46 JST wf#319; 2026-10-07 15:34 and 20:55 JST wf#345), each in the same second asSetting ACP session mode: ask. A directcursor-agent acpprobe receivedcurrent_mode_update(ask)4/4 times, so the confirmation arrives but can be processed after thesession/set_moderesponse.Why
_apply_acp_session_modereadget_current_mode_idexactly once, immediately aftersession/set_modereturned. When theCurrentModeUpdatenotification trails the response, the mode is not yet observed and startup fails even though the server does switch to the requested read-only mode.Summary
_ACP_SESSION_MODE_CONFIRM_TIMEOUT(5s), read at call time so tests can patch it._OpenHandsACPBridgekeeps a per-sessionasyncio.Eventset on every non-emptyCurrentModeUpdate; newwait_for_current_mode(session_id, timeout)waits on it (no sleep polling) and returns the confirmed mode orNone._apply_acp_session_mode: the existing acceptance rule is unchanged and returns without waiting. Only when nothing was observed does it wait (bounded) for the confirmation. Fail-closed: a timeout raisesACPSessionModeError(message includeswithin <timeout>s); a different confirmed mode, before or during the wait, raises immediately._verify_read_only_mode_after_config, provider qualification, public API and event shapes are unchanged. No CLI/adapter/provider version conditions.Issue Number
Fixes the race described in #67 (the issue is closed by the orchestrator after merge).
How to Test
env -u CLAUDE_CODE_OAUTH_TOKEN -u CLAUDE_AUTH_CODE .venv/bin/python -m pytest -q tests/sdk/agent/test_acp_permission_policy.py tests/sdk/agent/test_acp_agent.py(454 passed). The new tests aretest_read_only_waits_for_mode_update_after_set_mode_response,test_read_only_mode_confirmation_timeout_reports_wait,test_read_only_wrong_mode_update_fails_without_waiting,test_read_only_wrong_mode_before_response_fails_without_waiting, andtest_read_only_confirmed_before_response_does_not_wait. An autouse fixture shortens the timeout so the existing fail-closed tests stay fast. Wider validation (tests/sdk/settings, tests/sdk/agent/test_acp_agent.py, tests/agent_server, changed tests): 2622 passed. pyright and pre-commit pass on the changed files.(The
env -uis needed only on hosts that export Claude OAuth variables: two existingTestACPEnvConflictSuppressiontests read them. This is unrelated to this change.)Type