Repository navigation
feat(runtime): authorized Server Diagnose entry with a CLI provider diagnostic (#994) - #1329
Merged
yyjeqhc merged 2 commits intoOct 28, 2026
Merged
Conversation
…iagnostic Implements the remaining yyjeqhc#994 scope endorsed in the issue thread: one canonical Server/ToolRuntime entry that independently authorizes the exact Runner, provider generation, and authorized Project before forwarding the typed Runner Diagnose request from yyjeqhc#1129, plus a CLI operator command as its first consumer. - diagnose_coding_agent: model-visible runtime tool with observe-level static authority (Require(coding_agent:run), PureRead). The optional include_live_acp flag escalates at runtime to the exact start_coding_agent scope policy plus a fresh per-Project permission decision before any provider process is launched; presence-only stays spawn-free. - Resolution order is fail-closed: validate input, gate the live flag, resolve the Project for the caller, require the exact Runner semantic view and CodingAgentRuns capability, look up the current provider generation from the Runner inventory, then forward through the existing enqueue_coding_agent fence (which re-verifies identity, generation, online window, and access). - The Server re-verifies Runner response bounds (option/choice counts, identity byte bounds, stable kind vocabulary, options-only-on-success, env map bound) before projecting; violations collapse into invalid_runner_response. CODING_AGENT_MAX_ENV_MAPPINGS moves to core and is shared with the Runner's ACP config validation so the output schema can never disagree with what was admitted. - Projection is project/provider_id/env_presence/live_acp only; the provider instance id never crosses to callers. - CLI: webcodex ops diagnose-provider (--project, --provider, --include-live-acp) calls the same entry through the existing /api/tools/call bridge and renders presence booleans, live option identities, and an ops verdict; values, stderr, and credentials never reach the output.
Open
10 tasks
yyjeqhc
approved these changes
Oct 28, 2026
yyjeqhc
left a comment
Owner
There was a problem hiding this comment.
Reviewed the canonical Server/ToolRuntime Diagnose path and CLI consumer against #994, including the live-probe scope/Project authorization, Runner/provider fencing, bounded response projection, and non-disclosure. Added review commit 47193b0 to fix rustfmt plus live-response mode, bounded environment names, allowlisted current values, and uncertain launch semantics on lost responses. Focused validation: 14 server Diagnose tests and 4 CLI Diagnose tests passed; CI is being verified separately.
This was referenced Oct 28, 2026
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.
Context
Follow-up to #994 and the merged Runner-side primitive #1129. This implements the remaining scope endorsed by @swjnxyf in the issue thread: the canonical Server/ToolRuntime Diagnose entry first, with a small CLI diagnostic command as its first consumer. No Desktop surface in this round; the same authorized entry is what Desktop can reuse later.
Design notes:
docs/design/issue-994-server-diagnose-entry-design.md.What this adds
diagnose_coding_agent— one canonical Server/ToolRuntime entry (model-visible, next toobserve_coding_agent):observe_coding_agent: OAuth policyRequire(coding_agent:run), effectObserve, approvalNone, idempotencyPureRead, Runner capabilityCodingAgentRuns.include_live_acp=trueescalates at runtime — before any resolution, observation, or dispatch — to the exactstart_coding_agentscope policy (check_runtime_tool_scope) plus a fresh per-ProjectPermissionEvaluatordecision attached to the result. Presence-only never launches a process; observation authority never implies launch authority.coding_agent_runner_unavailablewhen offline/unauthorized) → current provider generation looked up from the Runner's advertised inventory (never caller-supplied) → typed forwarding through the existingenqueue_coding_agentfence, which independently re-verifies Runner identity, provider generation, online window, and access. Stale identities are rejected with bounded reason codes.select|booleankind vocabulary, the options-only-on-success invariant, and the env-presence map bound. Violations collapse intoinvalid_runner_response.CODING_AGENT_MAX_ENV_MAPPINGSmoves to core and is now shared with the Runner's ACP config validation, so the output schema can never disagree with what was admitted.project,provider_id,env_presence(booleans only), andlive_acp(the bounded typed diagnostic,nullunless requested). The provider instance id never crosses to callers, matchingsafe_provider_inventory.CLI consumer —
webcodex ops diagnose-provider --project <id> --provider <id> [--include-live-acp]:/api/tools/callbridge with the operator credential (token/env-file precedence shared with the otheropscommands). No separate ACP client, no new HTTP endpoint, no self-inspected CLI environment.present/ABSENT), live option identities when requested, and an ops verdict (warnfor absent env sources — the Windows-propagation case from Support: official ACP Codex model allowlist approval and runner:manage verification #990;failfor bounded server-side failures).--strictmaps FAIL to exit 2. Values, provider stderr, instance ids, and credentials never reach the output.Boundaries preserved (per the review checklist)
stale_coding_agent_provider,stale_coding_agent_projectpass through from the Runner fence; the registry independently re-checks).busycontract, and process-tree cleanup from feat(acp): add bounded read-only provider diagnostics (#994) #1129 — no prompts, no provider tools, no configuration writes, no raw stderr, no environment values.Tests
New coverage:
coding_agent:run-only andproject:write-only tokens (coding_agent_live_probe_authority_required); presence-only needs no start authority; the gate holds through the full dispatch path (router pre-resolution included); restricted authority mode denies the live probe per Project while presence-only stays permission-free.diagnose_coding_agenthidden from under-scoped catalogs and kept behindcall_runtime_toollike its siblings.Suites run on this branch (all green):
cargo test -p webcodex --libcargo test -p webcodex-runnercargo test -p webcodex-tool-contractscargo test -p webcodex-tool-runtime-contractscargo test -p webcodex-clicargo fmt --all --checkcargo clippy --workspace --all-targets -- -D clippy::correctnessOut of scope (unchanged)
Desktop "Diagnose" action, real-operator ACP verification against a commercial provider binary, and any change to the #1129 Runner contracts. #994 stays open per the review guidance until the authorized entry and at least one usable surface are verified — this PR is exactly that pairing.
Refs #994. Built on #1129.