🐛 Bug Report: /new Command Fails to Resolve "Token quota exceeded"
Description
Agent: assistant (general-purpose) Model: anthropic:glm-5 Workspace: /Users/ych/.openfang/workspaces/assistant Date: 2026-03-07 Description After executing the /new command, the system still throws the error:
CopyError: Token quota exceeded. Try /compact or /new to free up space.
Expected Behavior
Expected Behavior /new should completely clear the context, reset the session state, and release all token quota.
Actual Behavior Even after running /new, the token quota remains exceeded, making it impossible to continue the conversation.
Investigation Workspace configuration files are normal size (AGENTS.md ~500B, SOUL.md ~100B, etc.) — no file bloat issue.
Possible Causes /new command does not properly reset the token counter System-level context management bug glm-5 model context window configuration issue Suggested Fix Review /new command implementation to ensure complete token count reset Add debug logging for token usage to aid troubleshooting
Steps to Reproduce
Start a conversation with an agent Engage in multiple turns of dialogue (or have a long previous session with context summary) Encounter "Token quota exceeded" error Execute /new command to start a fresh session Observe that the error persists despite the session reset
OpenFang Version
0.3.25
Operating System
macOS (Apple Silicon)
Logs / Screenshots
No response
need openfang restart
Fixed together with #416. The budget default comparison was checking the wrong sentinel value, preventing global overrides from applying. The /new command already resets token usage via scheduler.reset_usage().