You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Consistent context usage tracking for stateless executions #56
Scheduler path (scheduler/agent_client.py:201): Stores only input_tokens
These are three different metrics stored in the same context_used column, making the data unreliable for comparison or display.
Additionally, context is only written to the DB at execution completion (update_execution_status()). During long-running tasks (30min+), context_used is NULL.
Expected Behavior
All stateless execution paths (manual task, scheduled, MCP-triggered, async) should compute context_used the same way: input_tokens + output_tokens
This is the best approximation available for stateless sessions since there's no persistent session state to query
The value should be stored consistently in the schedule_executions.context_used column
Gap: Headless task executions (POST /task) and scheduled tasks don't consistently capture context usage. The schedule_executions table has no context columns. Context info is only available when the agent returns it in the response, which stateless tasks don't always do.
Recommendation: Still valid. Would need the agent server to report context usage in task responses, and the backend to store it in execution records.
Activity
vybe commentedon Mar 30, 2026
Actualization (2026-03-30)
Current state: Context tracking exists for interactive sessions but not for stateless executions.
What exists:
context_used,context_maxinchat_messages)chat_sessionstable trackstotal_context_used,total_context_maxGap: Headless task executions (
POST /task) and scheduled tasks don't consistently capture context usage. Theschedule_executionstable has no context columns. Context info is only available when the agent returns it in the response, which stateless tasks don't always do.Recommendation: Still valid. Would need the agent server to report context usage in task responses, and the backend to store it in execution records.
docs(planning): Sprint A now 4/6 complete
fix(exec): use input_tokens only for context_used tracking (#56)
docs(planning): mark Sprint A complete (#56 shipped in PR #329)
test(unit): add context_used formula validation tests (#56)
fix(exec): use input_tokens only for context_used tracking (#56) (#329)
docs(orchestration): execution-bug meta-analysis + target-arch result…
feat(whatsapp): voice-out via shared TTS (#56) — stacked on #25 (#1398)
feat(slack): voice-out via shared TTS (#26) — closes epic #24, stacke…