Skip to content

v0.2.0-nightly.113

@nixuuu nixuuu tagged this 09 Nov 18:49
Codex bots could refuse Canopy tools with “approval policy is never”
before the request reached the gateway. Allow Canopy's authenticated MCP
transport at the harness level so the gateway can enforce bot approvals,
protected actions, standing rules and connector grants.

## Changes and cause

- Set `default_tools_approval_mode = "approve"` only on Codex bots'
Canopy MCP server, on both start and resume. Unannotated MCP tools
otherwise default to native approval, which Codex's internal `never`
policy refuses. Keep native `never`, the read-only sandbox, disabled
sandbox networking and the bot tool catalog unchanged.
- Add Grok's `MCPTool(canopy__*)` allow rule for bots and ordinary
threads. Its `ask` mode otherwise routes MCP permission requests through
ACP, where bot callbacks deny native permissions. Other MCP servers,
native tools and text-only generation keep their existing checks.
- Keep Claude's existing explicit Canopy tool allowlist.
`CLAUDE_SDK_CAN_USE_TOOL_SHADOWED` is expected for these tools: the
allowlist bypasses the SDK prompt, while the gateway still authorizes
execution.
- Turn native Canopy MCP refusals into actionable bot failures,
including Codex/Claude harnesses that subsequently report completion.
Use the same approval labels in the bot context and create-bot card as
in settings. Gateway validation accepts `safe`, `always`, `full_auto`,
defaulting empty values to `safe`; there is no bot `never` option.

The Codex refusal was reproduced with the installed official Codex
0.164.0 app-server, a local scripted Responses endpoint and the real
HTTP MCP transport. Removing the approval override makes that regression
fail; restoring it executes the gateway callback. Upstream
`request_mcp_tool_user_approval` confirms the native refusal and
`AppToolApproval::Approve` bypass. Ordinary Codex threads use
`dynamicTools`; a real app-server regression verifies `ask_user`,
`spawn_thread` and `send_message` in full auto.

No proto, migration or gateway authorization change. Documentation now
describes the harness/gateway approval boundary in Polish.

## Validation

- Gateway↔worker integration covers all 3 providers × all 3 bot approval
policies: protected `create_bot` has no effect before approval, then
creates a bot owned by the caller. Each provider also starts a full-auto
thread without a card. Native Codex/Claude denial fixtures verify
actionable failures, even after a completed harness turn.
- Focused bot harness, harness-error, approval-rule, isolation and Codex
adapter/permission tests passed. Isolation checks use the installed
Claude, Codex and Grok CLIs. Grok approval routing is covered with a
controlled ACP fixture and generated config; no paid live inference was
run.
- `bun install --frozen-lockfile`, `bun run typecheck`, `bun run lint`,
`bun run format:check`, `bun run gen:check` and the web build passed.
The changed packages and integration tests were typechecked again after
the final edits.
- Full local `check:tmp` intentionally omitted on the shared machine as
requested; CI remains the full-suite gate. No UI tests or browser/E2E
run.

## Copy audit — docs/copy.md §8

- `Approval policy: safe` → `Ask for approval: For actions that need
care` (and the corresponding shared labels for other policies). The card
and bot context now match the actual settings.
- Native refusal prose → “The agent CLI blocked this Canopy tool before
approval. Update the worker, then retry.” States the failure and the
recovery action without suggesting a nonexistent bot setting. Native
diagnostics remain sanitized.
- New user-facing copy uses English, sentence case, the glossary and
short sentences. No buttons, empty states, layout changes, color-only
cues or “soul” copy. Width/name checks are not applicable to the
unchanged layout; browser checks were not run.

Fixes: #97
Fixes: #104
Assets 2
Loading