MCPcopy Create free account
hub / github.com/FSoft-AI4Code/CodeWiki / _agent_tool_group_for_provider

Function _agent_tool_group_for_provider

codewiki/src/be/caw_backend.py:65–77  ·  view source on GitHub ↗

Return the caw tool group needed for a module-agent session.

(provider: str)

Source from the content-addressed store, hash-verified

63
64
65def _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
80def _resolve_caw_provider(provider: str) -> str:

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected