Return the caw tool group needed for a module-agent session.
(provider: str)
| 63 | |
| 64 | |
| 65 | def _agent_tool_group_for_provider(provider: str) -> ToolGroup: |
| 66 | """Return the caw tool group needed for a module-agent session.""" |
| 67 | if provider == "codex": |
| 68 | # Codex CLI 0.118+ discovers streamable-HTTP MCP servers in read-only |
| 69 | # or workspace-write sandbox mode, but cancels MCP tool calls in |
| 70 | # non-interactive `codex exec` with "user cancelled MCP tool call". |
| 71 | # In caw's Codex adapter, including EXEC maps the session to |
| 72 | # `--dangerously-bypass-approvals-and-sandbox`, which is currently the |
| 73 | # mode where CodeWiki's MCP tools run reliably. Codex cannot enforce |
| 74 | # finer-grained built-in tool restrictions anyway, so prompts still |
| 75 | # direct the agent to use CodeWiki's str_replace_editor for writes. |
| 76 | return _AGENT_TOOL_GROUP | ToolGroup.EXEC |
| 77 | return _AGENT_TOOL_GROUP |
| 78 | |
| 79 | |
| 80 | def _resolve_caw_provider(provider: str) -> str: |
no outgoing calls
no test coverage detected