2.1.278: Agent tool missing when first turn is a large skill/command payload (third-party ANTHROPIC_BASE_URL endpoint) — returns after compaction; TaskCreate missing since 2.1.265-268

Status Open
Reported on v2.1.278
Maintainer reply None cached
Activity 0 comments · opened Sep 21, 2026

Environment

  • Claude Code 2.1.278, native install, macOS (Darwin 27.0.0)
  • Third-party Anthropic-compatible endpoint via env in ~/.claude/settings.json: ANTHROPIC_BASE_URL (z.ai), ANTHROPIC_AUTH_TOKEN, ANTHROPIC_MODEL=glm-5.3[1M], ANTHROPIC_DEFAULT_{SONNET,OPUS,HAIKU,FABLE}_MODEL remapped to glm-5.3 / glm-5.3-flash, CLAUDE_CODE_SUBAGENT_MODEL=glm-5.3-flash[1M]
  • Permission mode: auto. No disallowedTools, no managed policy. Plugins include superpowers.

Bug 1 — Agent (subagent dispatch) tool dropped from the toolset under first-turn context pressure (2.1.278)

Whether a session gets the Agent tool depends on the size/type of the first user turn:

  • Broken session: first turn is a Skill invocation (inline payload ~15k+ chars, e.g. superpowers:brainstorming). The Agent tool is never registered — the model verified via 3 ToolSearch attempts that no dispatch tool exists in the deferred index (only SendMessage / ListAgents), and fell back to inline execution.
  • Working session (started 1 minute later, same machine/config): first turn is a short plain-text message. Agent tool present; subagents dispatch normally. Skills invoked from turn 2+ do not remove it.
  • 2.1.270 did not exhibit this: heavy superpowers sessions (skill kickoff, large context) dispatched 26–35 subagents without issue.

Decisive evidence — the tool comes back after compaction. In the broken session (Agent absent for ~90 minutes), an auto-compaction ran at 16:12:32Z and a successful Agent dispatch appears at 16:14:19Z — same session, no restart. So the toolset is recomputed per request from context pressure, and core tools get dropped when the first request already carries a large payload.

Repro (deterministic on my setup):

  1. New session with the env config above; first message invokes a Skill with a large body.
  2. Ask to dispatch a subagent → Agent tool missing (ToolSearch finds nothing).
  3. Same session: /compact, ask again → Agent tool available, dispatch works.
  4. Control: new session, plain-text first message → Agent tool available from the start.

Bug 2 — TaskCreate (todo) never registered since 2.1.265–268

Upgraded 2.1.263 → 2.1.268 (release sequence 263→265→266→267→268; there is no 2.1.264). Since then, across 2.1.268 / 2.1.270 / 2.1.278, on both glm-5.3 and glm-5.3-flash, in both plain-opening and heavy-opening sessions: zero TaskCreate dispatches in every transcript (50 recent sessions verified). On 2.1.263 the same setup used TaskCreate normally (last use the day before the upgrade). The tool code is present in the binaries (strings), so this is runtime gating, not removal. Rolling back to 2.1.263 restores it.

Suspected mechanism

Both symptoms point at per-request toolset computation (deferral/budget) interacting badly with third-party endpoints — plausibly endpoint capability detection failing and falling back to aggressive pruning (Agent under pressure, TaskCreate always). The changelog's own record of gateway-only regressions in this window (2.1.265 Artifact-tool schema regex rejected by third-party endpoints → fixed in 2.1.268; 2.1.275 advisor_20260301 input tag breaking every request via ANTHROPIC_BASE_URL → fixed in 2.1.276) suggests this path is undertested.

Happy to share session transcripts and full config (minus credentials) if useful.

View original on GitHub ↗