Skip to content

Commit dec790a

Browse files
feat(agents): Claude Code 2.1.322, which knows Claude Fable 5.2 (#612)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent ca162d4 commit dec790a

6 files changed

Lines changed: 21 additions & 11 deletions

File tree

‎src/agent_env/agents/README.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ run it. The CLI's version is the Dockerfile's
2424
`node`, without npm or npx, and the Python packages `model-requirements.txt` pins. A `deploy_agent` `builtin_tools`
2525
selection picks the CLI's own tools: `{"disable": "*"}` and `{"only": [...]}` become its `--tools` list, a list to
2626
turn off becomes `--disallowedTools`, which keeps the CLI's defaults for the rest, and any selection adds
27-
`--strict-mcp-config`, so its MCP servers are only the task env's. The names are `ClaudeCodeTool`'s in
27+
`--strict-mcp-config`, so its MCP servers are only the task env's. Tool search is off unless the agent's environment sets
28+
`ENABLE_TOOL_SEARCH`, so the CLI sends the env's tools and its own up front. The names are `ClaudeCodeTool`'s in
2829
`claude_bridge.py`: every tool the pinned CLI has, though which it offers by default depends on the model. A test fails
2930
when the Dockerfile's `CLAUDE_CODE_VERSION` moves, until `ClaudeCodeTool` and `TOOLS_CLI_VERSION` move with it.
3031

‎src/agent_env/agents/agents/claude-code/Dockerfile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ FROM public.ecr.aws/docker/library/python:3.11-slim@sha256:c20888b6acdd1e63e1c43
66
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates curl poppler-utils \
77
&& rm -rf /var/lib/apt/lists/*
88
# Claude Code's native build for this machine's platform, checked against its release manifest.
9-
ARG CLAUDE_CODE_VERSION=2.1.280
9+
ARG CLAUDE_CODE_VERSION=2.1.322
1010
RUN set -eu; \
1111
case "$(uname -m)" in x86_64) platform=linux-x64 ;; aarch64) platform=linux-arm64 ;; \
1212
*) echo "Claude Code has no build for $(uname -m)" >&2; exit 1 ;; esac; \

‎src/agent_env/agents/agents/claude-code/claude_bridge.py‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ def project_dir(workspace: Path) -> Path:
5656

5757

5858
# The CLI version ClaudeCodeTool names the tools of; a test holds it to the Dockerfile's CLAUDE_CODE_VERSION.
59-
TOOLS_CLI_VERSION = "2.1.280"
59+
TOOLS_CLI_VERSION = "2.1.322"
6060
# The CLI's own tools, by the names its model sees. Which of them it offers by default depends on the model, and its MCP
6161
# resource tools come only with MCP servers.
6262
ClaudeCodeTool = Literal["Agent", "Bash", "CronCreate", "CronDelete", "CronList", "Edit", "EnterWorktree",
63-
"ExitWorktree", "ListAgents", "ListMcpResourcesTool", "NotebookEdit", "Read",
63+
"ExitWorktree", "ListAgents", "ListMcpResourcesTool", "Monitor", "NotebookEdit", "Read",
6464
"ReadMcpResourceDirTool", "ReadMcpResourceTool", "ReportFindings", "ScheduleWakeup",
6565
"SendMessage", "Skill", "TaskCreate", "TaskGet", "TaskList", "TaskStop", "TaskUpdate",
6666
"WebFetch", "WebSearch", "Workflow", "Write"]
@@ -194,6 +194,8 @@ def cli_env(environ: Mapping[str, str], *, model: str | None = None, project_id:
194194
env["ANTHROPIC_CUSTOM_HEADERS"] = "\n".join(f"{name}: {value}" for name, value in headers.items())
195195
if max_thinking_tokens:
196196
env["MAX_THINKING_TOKENS"] = str(max_thinking_tokens)
197+
# Left on, the CLI sends no MCP tool and only some of its own until the model searches for them.
198+
env.setdefault("ENABLE_TOOL_SEARCH", "false")
197199
# Older CLIs prepend a changing attribution block to the system prompt on custom base URLs, which defeats the
198200
# provider's prefix cache.
199201
env["CLAUDE_CODE_ATTRIBUTION_HEADER"] = "0"
@@ -593,8 +595,8 @@ async def feed_stdin() -> None:
593595

594596
# Behind a gateway the CLI gives a bare id of these a 200K window, and envs whose tool definitions alone pass that
595597
# make it exit with "Autocompact is thrashing". Add a model only once the pinned CLI maps its [1m] form.
596-
_NATIVE_1M_MODELS = frozenset({"claude-opus-5", "claude-opus-5-5", "claude-fable-5-1", "claude-opus-4-8",
597-
"claude-opus-4-7"})
598+
_NATIVE_1M_MODELS = frozenset({"claude-opus-5", "claude-opus-5-5", "claude-fable-5-1", "claude-fable-5-2",
599+
"claude-opus-4-8", "claude-opus-4-7"})
598600

599601

600602
def _with_1m_window(model: str) -> str:

‎tst/integration/cli/run_bundle_claude_code_install_test.py‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,8 @@ def test_a_retried_install_replaces_the_agent_an_earlier_attempt_left_running_in
135135
"""The first turn fails, and its retry installs again into the same container, on the same port, while the
136136
first install's agent still runs there."""
137137
endpoint.respond = tool_then_answer("Bash", {"command": f"cat notes.txt; pwd; {READ_SKILL}"})
138-
endpoint.fail_next(Fault("status", status=400))
138+
# A 403, which the CLI never resends; a 400 it resends without some of its betas.
139+
endpoint.fail_next(Fault("status", status=403))
139140
bundle = _bundle(state / "bundle", "debian")
140141
task = bundle / "tasks/install.json"
141142
steps = json.loads(task.read_text())
@@ -190,7 +191,8 @@ def test_a_retried_host_install_stops_the_agent_an_earlier_attempt_started(monke
190191
"""install_agent empties its work dir before each attempt, so the first install's agent must live outside it:
191192
found there, it is stopped, rather than keeping the port the retry's agent needs."""
192193
endpoint.respond = tool_then_answer("Bash", {"command": f"echo {NOTES}; {READ_SKILL}"})
193-
endpoint.fail_next(Fault("status", status=400))
194+
# A 403, which the CLI never resends; a 400 it resends without some of its betas.
195+
endpoint.fail_next(Fault("status", status=403))
194196
bundle = _bundle(state / "bundle", None, agents=("helper",))
195197
task = bundle / "tasks/install.json"
196198
steps = json.loads(task.read_text())

‎tst/unit/agents/claude_code/test_claude_bridge_model.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ def _cli_model(model: str | None) -> str | None:
1111
return cmd[cmd.index("--model") + 1] if "--model" in cmd else None
1212

1313

14-
@pytest.mark.parametrize("model", ["claude-opus-5-5", "claude-opus-5", "claude-fable-5-1", "claude-opus-4-8",
15-
"claude-opus-4-7"])
14+
@pytest.mark.parametrize("model", ["claude-opus-5-5", "claude-opus-5", "claude-fable-5-1", "claude-fable-5-2",
15+
"claude-opus-4-8", "claude-opus-4-7"])
1616
def test_a_native_1m_model_gets_its_1m_window(model):
1717
assert _cli_model(model) == f"{model}[1m]"
1818

‎tst/unit/agents/claude_code/test_cli_env.py‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ def test_anthropic_variables_already_set_are_kept():
4141
assert (env["ANTHROPIC_AUTH_TOKEN"], env["ANTHROPIC_BASE_URL"]) == ("own", "https://own.example")
4242

4343

44+
def test_the_cli_offers_its_tools_up_front_unless_tool_search_is_asked_for():
45+
assert claude_bridge.cli_env(GATEWAY)["ENABLE_TOOL_SEARCH"] == "false"
46+
assert claude_bridge.cli_env({**GATEWAY, "ENABLE_TOOL_SEARCH": "auto"})["ENABLE_TOOL_SEARCH"] == "auto"
47+
48+
4449
def test_no_endpoint_leaves_the_cli_to_its_own_and_an_api_key_alone():
4550
env = claude_bridge.cli_env({"ANTHROPIC_API_KEY": "direct"}, model="claude-x")
4651

@@ -141,7 +146,7 @@ async def _exec(*cmd, **kwargs):
141146

142147
@pytest.mark.parametrize("workspace, project", [
143148
("/app", "-app"),
144-
("/workspaces/my_ws.x-y/Sub Dir", "-workspaces-my-ws-x-y-Sub-Dir"), # as the CLI names it, checked against 2.1.280
149+
("/workspaces/my_ws.x-y/Sub Dir", "-workspaces-my-ws-x-y-Sub-Dir"), # as the CLI names it, checked against 2.1.322
145150
])
146151
def test_a_sessions_transcripts_are_where_the_cli_keeps_them_for_its_workspace(workspace, project):
147152
assert claude_bridge.project_dir(Path(workspace)) == claude_bridge.CLAUDE_STATE_DIR / "projects" / project

0 commit comments

Comments
 (0)