-
-
Notifications
You must be signed in to change notification settings - Fork 69.4k
config.schema returns 373KB response, causing context explosion #7347
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Summary
The gateway tool's config.schema action returns the entire JSON schema + help text (~373KB / 372,946 characters), which stays in session context and causes token explosion.
Impact
- Sessions hitting 170K+ tokens (near 200K limit)
- Single
config.schemacall adds ~100K tokens to context - Multiple calls compound the problem (observed 2x dumps = 766KB in one session)
Reproduction
- Agent encounters "invalid config" error from
config.patch - Agent requests
config.schemato understand correct structure - Gateway returns full 373KB schema
- Context explodes; session becomes unusable
Evidence
Session 7c03a526: 1 config.schema call → 170,505 tokens
Session 6ed0d989: 2 config.schema calls → 766KB stored, 2.3MB session file
Tool result sample (line 109):
{
"ok": true,
"result": {
"schema": {
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": { ... 372KB of schema ... }
}
}
}Suggested Fixes
- Truncate/summarize the schema response (return only relevant section based on query)
- Paginate the schema (return top-level keys first, drill down on request)
- Size limit on tool responses stored in session history
- Exclude from context - mark large tool results as non-cacheable in session
Environment
- clawdbot version: 2026.1.24-3
- Model: claude-opus-4-5-20251101 / claude-sonnet-4-20250514
- Platform: macOS Darwin 25.2.0
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Type
Fields
Give feedbackNo fields configured for issues without a type.