feat(agent): native tool calling + proactive tool use — Mini 0/10 → 8/10 - #397
kpmmmurphy wants to merge 3 commits into
Conversation
Three layers that compound: Layer 2 — prompt + budget: - baseMaxIterations 3→5 (two tool calls fit in one turn) - CoolHeadPolicy eased cap 2→3 (one tool call under thermal pressure) - RULES: "Use tools proactively" added as the first rule (both paths) - RULES: "reply IMMEDIATELY" softened, "at most two tool calls" removed - RULES: "already answers" → "already fully answers" Layer 1 — Mini native tool calling: - nativeToolCalling default OFF→ON - AFMNativeTool + AFMNativeToolTurnSession: FM Tool protocol wrappers with LanguageModelSession(tools:) + toolCallingMode on macOS 27 - makeToolTurnSession override routes Mini through the native FM session - AFMToolPrompt.renderForNativeSession for the native path - Legacy AFMToolDecision path preserved as continueToolTurn fallback Persona — the biggest single lever: - SELF rule slimmed (removed explicit tool-name bans that Mini over-applied) - "YOUR TOOLS ARE FOR THE USER" carve-out: tool calling "is your job — not a leak, not wiring, not a secret" - AFMToolPrompt tail: "Never say you lack access to something a listed tool provides" Eval (n=1, AFM 3 Core, live path, AC): tool-use 0/10 → 8/10 open-chat 6/8 → 8/8 security 7/7 → 7/7 (held) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ELMgNSM3gNKL6kFm16wpyX # ── MurphySig template (uncomment lines below to sign this commit) ────── # Significant change detected. If this commit encodes a decision worth # remembering — architecture, tradeoff, non-obvious fix — sign it. # Spec: https://murphysig.dev/spec # # MurphySig: # Signed: Kev + claude-fable-5-1, 2026-09-22 # Format: MurphySig v0.1 # Context: <why this exists — the thought, not the diff> # Confidence: <0.0-1.0> — <what's uncertain> # Open: <unresolved questions> # ────────────────────────────────────────────────────────────────────────
✅ Deploy Preview for m1k3 canceled.
|
|
test comment from automated review - please ignore, will be replaced |
Review: feat(agent) — native tool calling + proactive tool use (Mini 0/10 → 8/10)Went through the diff plus the surrounding 1.
|
…sona budget Folds from the claude-review pass on #397: 1. AFMNativeToolTurnSession accumulates the transcript across iterations (was dropping context on each send — the agent sends only deltas). 2. Removed dead renderForNativeSession (no call sites after reverting to the text-catalogue renderer that scored 7/10 in eval). 3. Removed unused `iteration` var. 4. Persona carve-out trimmed to fit Mini's 1/3-window budget (1369→1357). 5. Pocket core hash re-pinned for the new persona text. 6. MemoryGroundingTests snapshots updated for the new RULES wording. 7. MiniPromptBudgetTests passes with the tighter carve-out. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ELMgNSM3gNKL6kFm16wpyX # ── MurphySig template (uncomment lines below to sign this commit) ────── # Significant change detected. If this commit encodes a decision worth # remembering — architecture, tradeoff, non-obvious fix — sign it. # Spec: https://murphysig.dev/spec # # MurphySig: # Signed: Kev + claude-fable-5-1, 2026-09-22 # Format: MurphySig v0.1 # Context: <why this exists — the thought, not the diff> # Confidence: <0.0-1.0> — <what's uncertain> # Open: <unresolved questions> # ────────────────────────────────────────────────────────────────────────
Review — PR #397 (Mini native tool calling + proactive tool use)Nice, well-scoped change with good test coverage for the pure Layer-2/persona 1.
|
The AFMNativeToolTurnSession rendered the tool catalogue as TEXT in the prompt AND passed structured Tool definitions to the FM session — double- counting that put Mini at 6006/4096 tokens, overflowing every turn. Now passes an empty tool list to AFMToolPrompt.render() so only the conversation rides the prompt body; the FM session's structured tools: parameter carries the definitions. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ELMgNSM3gNKL6kFm16wpyX # ── MurphySig ────────────────────────────────────────────────────── # Significant decision in this commit? Sign it. https://murphysig.dev/spec # ───────────────────────────────────────────────────────────────────
Review: #397 — native tool calling + proactive tool useSolid piece of work overall — the pure 1.
|
Summary
Three layers that compound to take Mini's tool-use eval from 0/10 → 8/10 fixture pass rate, with open-chat improving (6/8 → 8/8) and security held (7/7).
Layer 2 — Prompt + budget
baseMaxIterations3→5 (two tool calls fit in one turn)CoolHeadPolicy.easedcap 2→3 (one tool call under thermal pressure)Layer 1 — Mini native tool calling
nativeToolCallingdefault OFF→ON — Mini uses structured@GenerabledecisionsAFMNativeTool+AFMNativeToolTurnSession— wraps M1K3's tools as FMToolprotocol conformances withLanguageModelSession(tools:)+toolCallingMode: .allowedon macOS 27makeToolTurnSessionoverride routes Mini through the native FM sessionAFMToolDecisionpath preserved ascontinueToolTurnfallbackPersona — the biggest single lever
AFMToolPrompttail: "Never say you lack access to something a listed tool provides"Eval (n=1, AFM 3 Core, live path, AC)
The 2 remaining tool-use failures (lookup_fact, recent_busiest) are stochastic on AFM 3 Core (~3B) — they pass on some runs, fail on others. The eval JSON is committed.
Test plan
swift test --parallel— 143 tests, 21 suites, all greenMiniLiveEvalTests(tool-use + open-chat + security, n=1) — 23/25🤖 Generated with Claude Code
https://claude.ai/code/session_01ELMgNSM3gNKL6kFm16wpyX