Skip to content

Mid-conversation tool changes (beta, 2026-07-24) could remove the restart from add_skill/remove_skill — and with it a whole hazard family #973

Description

@olegbrok

What shipped

Claude Platform release notes, 2026-07-24: mid-conversation tool changes are in beta on Claude Fable 5, Mythos 5, Opus 4.8 and Opus 5 — add or remove tools between turns of a conversation while preserving the prompt cache, via the mid-conversation-tool-changes-2026-07-01 beta header. The Python SDK gained the matching surface in anthropic-sdk-python v0.120.0 (2026-07-24): "add tool addition/removal blocks and tool_change events."

Why this matters here specifically

Skill changes currently require a session restart. From src/pinky_self/server.py:1791 and :1828:

"Equip a skill and restart to activate its tools."
"Unequip a skill and restart to deactivate its tools."

That restart is the trigger for our single largest hazard family. Every one of these is a restart-boundary defect:

issue what the restart costs
#747 queued scheduler wakes silently lost across restart
#943#945 wedged-REPL force-restart discards the dispatch deque
#953#954 composer Enter-loss on the re-pasted wake
#966 delivery-receipt false negatives around turn boundaries
#946 context_status serves the dead session's usage for ~3 min

Plus the unticketed cost: the agent loses working context and has to reload from save_my_context.

So "add a skill" currently means "accept a restart," and a restart means "roll the dice on the hazard family above." If tools can change between turns, an entire class of restarts stops being necessary — not mitigated, not made safer, simply not triggered. That is a better outcome than any fix to the restart path itself.

The open question — check this first

We have no beta-header plumbing at all today. grep -rnE "ANTHROPIC_BETA|anthropic-beta|betas=" src/ --include="*.py" returns nothing. Our agents run through Claude Code and the Agent SDK rather than raw Messages API calls, so the real question is not "does the API support this" (it does) but "does our harness expose a way to pass the beta header and to mutate the tool set mid-session?"

That is the first thing to establish, and it may kill the idea outright. Do not start on the skill-swap logic before it is answered.

Suggested order:

  1. Determine whether the Agent SDK / Claude Code path can send mid-conversation-tool-changes-2026-07-01 and drive tool add/remove mid-session. If it can't, close this and revisit when it can.
  2. If it can, prototype add_skill on one agent without a restart, and verify the prompt cache actually survives — the cache preservation is most of the value, and a tool change that busts the cache on a 1M-context Opus 5 session is a real cost, not a neutral one.
  3. Only then consider remove_skill, which is the riskier direction: removing a tool mid-session while a turn may be mid-flight needs its own thinking about in-flight calls to the removed tool.

Not claimed

I have not verified that the Agent SDK exposes this. I have verified the API supports it, that the SDK has the request/event types, that our skill tools restart today, and that we have no beta-header path. The rest is the investigation this issue is asking for.


🤖 Filed by Barsik

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions