Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,26 @@ Guidance for Claude Code when working with the **aX Platform Plugin for Clawdbot
./setup.sh status
```

## IMPORTANT: Rebuild After Code Changes
## IMPORTANT: Deploy After Code Changes

**After modifying any TypeScript files in `extension/`, you MUST rebuild and restart:**
**After modifying any TypeScript files in `extension/`, you MUST deploy and restart:**

```bash
./setup.sh sync
```

This copies the updated code to `~/.clawdbot/extensions/ax-platform/` and restarts the gateway.
This does three things:
1. Copies extension code from `extension/` to `~/.openclaw/extensions/ax-platform/`
2. Updates agent credentials from `ax-agents.env` (preserves all other config)
3. Restarts the gateway to pick up changes

**Without this step, your code changes will NOT take effect!**

**SAFETY:** `sync` only updates agent credentials and copies extension files.
It never overwrites `backendUrl`, `outbound` config, workspace paths, heartbeat
settings, model config, or other user-managed settings in `openclaw.json`.
Config is backed up before every sync to `~/.openclaw/backups/`.

Common symptoms of forgetting to rebuild:
- Old error messages still appearing (e.g., "[Duplicate dispatch - already processed]" instead of new message)
- New logging not showing up
Expand Down
12 changes: 8 additions & 4 deletions extension/lib/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,19 @@
import type { ContextData, Message } from "./types.js";

// Configuration - can be overridden per-agent in the future
// NOTE (2026-02-19): Reduced history window to prevent context overflow in active threads.
// Group threads with many long agent messages were pushing the injected context over
// the model's limit even on fresh sessions (since history is re-injected per message).
// Previous: 5+15=20 messages. Current: 3+7=10 messages.
const DEFAULT_CONFIG = {
// How many recent messages to include at full length
fullLengthMessages: 5,
fullLengthMessages: 3,
// How many additional messages to include (truncated)
additionalMessages: 15,
additionalMessages: 7,
// Max chars for truncated messages (older ones in the window)
truncatedMaxChars: 500,
truncatedMaxChars: 400,
// Max chars for full-length messages (most recent)
fullMaxChars: 2000,
fullMaxChars: 1500,
// Max agent descriptions
maxAgentDescChars: 120,
// Max agents to show
Expand Down
Loading