/code-review xhigh --fix master
- User
/code-review xhigh --fix master
- User
code-review /code-review xhigh --fix master
Assistant· claude-opus-4-8
I'll start by gathering the diff under review.
Assistant· claude-opus-4-8
Working tree is clean. Let me get the full diff for review.
Assistant· claude-opus-4-8
Let me read the full diff and the key source files.
Assistant· claude-opus-4-8
I have the full diff. Now let me build deep context by reading the supporting source files that this code depends on, so I can verify correctness claims.
Assistant· claude-opus-4-8
Let me verify the critical correctness questions: the rule-key composition format, and the signatures of
exec_in_sandbox/get_active_policy.Assistant· claude-opus-4-8
Now the critical question — how OpenShell actually names provider rule keys in the policy. Let me check how provider rules get composed.
Assistant· claude-opus-4-8
The
_provider_prefix exists only in the new code — it's an assumption about OpenShell's internal rule naming. Let me check for reuse opportunities (sandbox-name resolution pattern) and run the baseline build/test.Assistant· claude-opus-4-8
There's an existing block at line 1484 doing the same parse_agent_config → resolve_sandbox_name → connect_grpc pattern. Let me read both to assess duplication.
Assistant· claude-opus-4-8
Now I have a strong model of the code. Let me kick off baseline tests in the background and dispatch parallel finder agents covering the review angles.
Assistant· claude-opus-4-8
Now let me dispatch parallel finder agents covering the review angles.
Assistant· claude-opus-4-8
Baseline tests passed. Let me confirm the output, then consolidate the findings.
Assistant· claude-opus-4-8
Baseline green. The finders surfaced overlapping candidates centering on the new
provider_capabilities.rs. The strongest theme: the in-sandboxenvscan reimplements an existing authoritative gRPC RPC. Let me verify the key facts before deciding fixes.Assistant· claude-opus-4-8
Confirmed the key facts:
get_sandbox_provider_environment(client, sandbox_id) -> HashMap<name, placeholder>exists and is the authoritative source of injected provider env vars (keys = names).ProviderError::NotFoundexists for the race fix.list_attacheddiscards everything but the name from the protoProvider(which carriestype).
Let me check how the CI test waits for the placeholder, and what
wait_for_provider_placeholderkeys on, to make sure switching the env source is safe.Assistant· claude-opus-4-8
The CI test confirms the placeholder appears via the gateway injection (
printenvshowsopenshell:resolve:env:…), which is exactly whatget_sandbox_provider_environmentreturns authoritatively. So switching the env source is safe and keeps the CI test green. Let me check the proto comment aboutnetwork_policieskeying to assess the_provider_prefix claim.Assistant· claude-opus-4-8
The proto comment documents user-authored rule names (
claude_code,gitlab) — it doesn't document the gateway's composed provider-rule key naming, so the_provider_prefix remains an unverified external assumption (B1). I'll report that but not rip out a path the author may have verified live against a path I can't reach here.Now let me apply the two safe, high-value in-scope fixes. First, read the exact file regions for precise edits.
Assistant· claude-opus-4-8
The actual file ordering differs from the diff preview. Let me locate the exact functions to edit.
Assistant· claude-opus-4-8
Now I'll apply FIX 1 (replace the SSH env scan with the authoritative
get_sandbox_provider_environmentRPC):Assistant· claude-opus-4-8
Now FIX 2 (survive a provider detached mid-call instead of failing the whole tool):
Assistant· claude-opus-4-8
Now remove the unit test for the deleted
env_keys_from_stdouthelper:Assistant· claude-opus-4-8
Now let me verify the build and run the targeted tests for both affected crates.
Assistant· claude-opus-4-8
Unit tests pass. Now let me confirm the CI integration test still compiles, run the
rightbackend tests, and run clippy on the changed crates.Assistant· claude-opus-4-8
Let me run the
rightlib tests for the handler explicitly and confirm they execute (not just filter).Assistant· claude-opus-4-8
rightis a binary crate; tests live in the bin target. Let me run them targeting the bin and capture the result.Assistant· claude-opus-4-8
All handler tests pass. Now clippy on the changed crates, then the mandatory full workspace test.
Assistant· claude-opus-4-8
Let me check whether any clippy warning is in my changed code specifically.
Assistant· claude-opus-4-8
right-openshellis clippy-clean (the listed warnings belong toright-mcp, a pre-existing dependency). My changes introduce no new lints. Now the mandatory full workspace test.Assistant· claude-opus-4-8
The tail only showed doctests. Let me confirm no test binary failed anywhere in the run.
Assistant· claude-opus-4-8
No failures across the full workspace (60
test result: ok, zero failed/errored/panicked). Let me show the net change I applied.Assistant· claude-opus-4-8
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.