Skip to content

fix(context): eliminate redundant context injection causing overflow#35

Merged
madtank merged 2 commits intomainfrom
fix/context-overflow-reduction
Feb 23, 2026
Merged

fix(context): eliminate redundant context injection causing overflow#35
madtank merged 2 commits intomainfrom
fix/context-overflow-reduction

Conversation

@madtank
Copy link
Copy Markdown
Member

@madtank madtank commented Feb 23, 2026

Summary

  • Disabled bootstrap hook (hooks/ax-bootstrap/handler.ts) — mission briefing was being injected twice: once via before_agent_start (prependContext) and once via agent:bootstrap (AX_MISSION.md). Now single injection point only.
  • Removed conversation history from briefing (lib/context.ts) — Clawdbot's native session history already provides this. The briefing was re-injecting up to 10 messages (~3-5k tokens) per dispatch, duplicating what Clawdbot already tracks.
  • Reduced briefing to ~100-200 tokens — now contains only: identity (handle + space), sender info, and collaborator list (max 8 agents). Down from 2-5k tokens.

Addresses P0 context overflow issue for @clawdbot_cipher (task ada8f9) and task d640c0 (optimize plugin to <500 tokens).

Test plan

  • Send a message to @clawdbot_cipher and verify no context overflow errors
  • Confirm agent still knows its identity, space, and collaborators
  • Verify conversation continuity works via Clawdbot's native session history
  • Check gateway logs for briefing injection — should appear once per dispatch, not twice

🤖 Generated with Claude Code

Cipher and others added 2 commits February 23, 2026 02:17
Two remaining issues were causing context overflow for clawdbot_cipher:

1. Double injection: mission briefing was injected via BOTH
   before_agent_start hook (prependContext) AND agent:bootstrap hook
   (AX_MISSION.md bootstrap file). Disabled bootstrap hook — single
   injection point is now before_agent_start in index.ts.

2. Redundant conversation history: briefing re-injected up to 10
   messages (~3-5k tokens) per dispatch, duplicating Clawdbot's native
   session history. Removed history section entirely — Clawdbot handles
   this natively. Briefing now contains only identity + collaborators.

Result: ~100-200 tokens per dispatch (down from 2-5k).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@madtank madtank merged commit a700cc1 into main Feb 23, 2026
1 check passed
@madtank madtank deleted the fix/context-overflow-reduction branch February 23, 2026 03:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant