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
Create execution records for /api/chat endpoint (unify with task tracking) #96
The /api/chat endpoint is the ONLY execution path that does not create records in the execution table (schedule_executions). It only writes to chat_messages. This means:
Chat executions don't appear in the Tasks tab history
Chat executions can't be queried via the execution API
Chat execution costs/metrics aren't tracked in the unified execution log
The only exception is MCP-triggered chats (agent-to-agent), which DO create execution records
Current Behavior
Path
Creates Execution Record?
Creates Activity?
/api/chat (user)
NO
YES
/api/chat (MCP)
YES
YES
/api/task
YES
YES
Public chat
YES
NO
Paid chat
YES
NO
Scheduled
YES
YES
Impact
No unified view of ALL work an agent has done
Chat costs not aggregated with task costs
Can't answer "how many total executions did this agent run today?" without querying two tables
Inconsistent data model makes reporting unreliable
Required Changes
Create execution record for every /api/chat call (not just MCP)
Use triggered_by="chat" to distinguish from tasks
Link the execution record to the chat message via existing related_execution_id in activities
Ensure execution queue still works (queue manages concurrency, execution record tracks history)
Update Tasks tab to optionally show/filter chat executions
Considerations
This will increase schedule_executions row count significantly (every chat message = 1 record)
Activity
feat: Create execution records for all /api/chat calls (Abilityai#96)
refactor(chat): extract execute+finalize into _run_chat_and_finalize (#…
refactor(chat): decompose chat_with_agent into admit/prepare/execute …
feat(executions): GET /api/executions/timeline — bucketed fleet rollu…
feat(executions): GET /api/executions/timeline — bucketed fleet rollu…