cloudflare / cloudflare/agents
Devtool / debug panel for Agents/Think (tools, message viewer, prompt visibility)
- Dominant language
- TypeScript
- Stars
- 5.6k
- Forks
- 711
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 53
Description
**Problem**
When building agents with `@cloudflare/agents` (specifically using Think), there's no built-in way to inspect what's happening at runtime. As the agent grows in complexity — dynamic tools, sub-agents,
context providers, custom prompts — debugging becomes increasingly painful.
**Current debugging workflow**
Backend:
- To see which tools are currently active, I have to add console.log statements in getTools() and check Worker logs
- To see what the agent responded with (text, tool calls, tool results), I add logging in onChatResponse, beforeToolCall, afterToolCall, etc.
- There's no visibility into the system prompt / context that was assembled for a given turn (e.g. what configureSession and beforeTurn produced)
Client (WebSocket):
- To inspect tool call messages and their payloads, I have to open browser DevTools → Network → WS tab and manually read through raw WebSocket frames
- There's no structured view of the message flow: user message → tool calls → tool results → assistant response
- When building custom UI for specific tool calls (e.g. rendering a tool's output as a component), debugging whether the right data is arriving requires reading raw WS JSON
What would help
A developer-mode debug panel that shows:
1. Active tools — list of currently registered tools with their schemas, so you can verify the agent sees the right tools for a given turn
2. Turn inspector — for each turn, show: assembled system prompt, user message, LLM response (text + tool calls), tool execution results, and final assistant message
3. WebSocket message viewer — structured, filterable view of all WS messages between client and agent (not raw JSON frames)
4. Context/prompt viewer — what configureSession contexts resolved to, what beforeTurn injected into the system prompt
This could be a local dev-only UI would be huge improvement over the current `console.log` approach.
**Context**
I'm using Think with:
- Dynamic tools via getTools() that change based on conversation state
- configureSession with multiple context providers
- beforeTurn / afterTurn hooks for tracing and prompt injection
- Custom client UI that renders different components per tool call type
The more sophisticated the agent gets, the harder it is to debug without proper tooling.
___
agents is awesome 💯
Contributor guide
Research direction
Start by tracing Think's getTools(), configureSession, beforeTurn, afterTurn, and onChatResponse flows, then inspect how WebSocket messages move between the client and agent. Define the dev-only panel's scope around active tools, turn details, prompt/context visibility, and structured message filtering. Done should provide those views without relying on console logs or raw WebSocket frames.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- ai, devtools, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100