Skip to content

M4.5 — Extended thinking sur Investigator (Opus 4.7 wow factor) #27

Description

@zestones

Note

Milestone: M4 — Sentinel + Investigator
Planning doc: docs/planning/M4-sentinel-investigator/issues.md

Scope. Activer thinking sur l'agent loop Investigator. C'est le seul argument
visible "pourquoi Opus 4.7 vs Sonnet" pour les juges.

response = await anthropic.messages.create(
    model=model_for("agent"),
    thinking={"type": "enabled", "budget_tokens": 10000},
    system=INVESTIGATOR_SYSTEM,
    messages=messages,
    tools=tools_schema,
    stream=True,
)

Streaming. À chaque chunk thinking_delta reçu du SDK Anthropic, broadcast :

await ws_manager.broadcast("thinking_delta", {
    "agent": "investigator",
    "content": chunk.thinking_delta.text,
    "turn_id": turn_id,
})

Périmètre. Activé uniquement sur Investigator. Budget 10k tokens ≈ 5¢ par
run avec Opus 4.7, négligeable. Les autres agents n'en ont pas besoin (et économie
coûts).

Pourquoi critique. Le frontend (M8.5 Agent Inspector) streame le thinking en
live dans un panel dédié → le juge voit Opus réfléchir. Sans ça, "pourquoi
Opus 4.7 ?"
n'a pas de réponse visuelle. 25% de la note.

Acceptance.

  • thinking_delta events streamed pendant un run Investigator
  • Frontend M8.5 affiche le thinking en live (vérifié J6)
  • Latence end-to-end Investigator reste < 60s avec thinking activé

Bloque. Frontend M8.5, prix "Opus 4.7 Use".


Thinking stream timing

sequenceDiagram
    autonumber
    participant Inv as Investigator
    participant Claude as Opus 4.7 (thinking enabled)
    participant WS as WSManager
    participant UI as Agent Inspector (M8.5)

    Inv->>Claude: messages.create(thinking={budget:10000}, stream=true)
    loop stream chunks
        Claude-->>Inv: thinking_delta
        Inv->>WS: broadcast thinking_delta
        WS-->>UI: render token
    end
    Claude-->>Inv: text_delta + tool_use
Loading

Important

Activated only on Investigator. Budget 10k tokens ≈ 5¢ per RCA. This is the
only visible answer to "why Opus 4.7 and not Sonnet".

Metadata

Metadata

Assignees

Labels

agentTouches an Anthropic agent loop or orchestrationbackendChangement on back sidepriority:p0Critical path / demo blockerprize:opus-4-7Required to showcase Opus 4.7 featuresstreamingWebSocket / SSE streaming workwow-factorVisible differentiator vs a plain chatbot

Projects

  • Status
    ✅ Done

Relationships

None yet

Development

No branches or pull requests

Issue actions