Skip to content

Conversation

@ammar-agent
Copy link
Collaborator

Implements a small status-transition state machine for agent tasks:

  • Centralizes taskStatus writes in TaskService.setTaskStatus with allowed transitions (queued|running|awaiting_report|reported)
  • Ensures invariants:
    • Clears taskPrompt once a task leaves queued
    • Stamps reportedAt when entering reported
  • Replaces direct config writes of taskStatus="reported" with the transition helper
  • Adds unit tests for invalid transitions + reportedAt stamping

Validation:

  • bun test src/node/services/taskService.test.ts
  • make static-check

Generated with mux • Model: openai:gpt-5.2 • Thinking: xhigh

@ammar-agent ammar-agent force-pushed the fix/task-status-transitions branch 2 times, most recently from 3aebb5b to 7e98914 Compare January 4, 2026 18:48
- Add explicit AgentTaskStatus transition map and validate all status writes\n- Ensure task_await resolves for already-reported tasks after restart/cache expiry\n- Deduplicate report finalization + ancestor traversal helpers and extend tests
@ammar-agent ammar-agent force-pushed the fix/task-status-transitions branch from 5d16f0f to cc1f2ce Compare January 5, 2026 00:02
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