Skip to content

feat: redesign canonical task statuses and harden OpenClaw plugin defaults#57

Merged
Tweakzx merged 2 commits intomainfrom
feat/status-model-main-20260401
Apr 1, 2026
Merged

feat: redesign canonical task statuses and harden OpenClaw plugin defaults#57
Tweakzx merged 2 commits intomainfrom
feat/status-model-main-20260401

Conversation

@Tweakzx
Copy link
Copy Markdown
Owner

@Tweakzx Tweakzx commented Apr 1, 2026

Summary

  • redesign AgentFlow lifecycle to canonical statuses only:
    • todo -> ready -> in_progress -> review -> done
    • plus blocked and dropped
  • remove legacy runtime status aliases from store/console/plugin input handling
  • keep schema-side normalization for existing historical rows during migration
  • improve OpenClaw plugin usability:
    • smarter default project inference (config/env/repo-name fallback)
    • enforce priority/impact/effort range (1-5) in plugin schemas and runtime checks
    • improve OpenClaw dispatch error diagnostics for HTTP failures (status/body preview)

Follow-up Fix (P1)

  • fix regression for upgraded DB files where tasks.status table default may still be pending
  • add_task now explicitly inserts status='todo' to keep task state and claim queries consistent
  • added regression coverage to verify tasks are claimable even when legacy table default is pending

Validation

  • PYTHONPATH=src python3 -m unittest discover -s tests
  • Result: Ran 55 tests ... OK (skipped=4)

Notes

  • This PR intentionally enforces canonical status names at runtime.
  • Legacy names (pending/approved/pr_ready/pr_open/merged/skipped/triaged) are no longer accepted by move/status APIs.

@Tweakzx Tweakzx marked this pull request as ready for review April 1, 2026 10:34
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4c37fa77e8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/agentflow/store.py
Comment on lines 138 to +140
conn.execute(
"INSERT INTO status_history(task_id, from_status, to_status, note) VALUES(?, ?, ?, ?)",
(task_id, None, "pending", "task created"),
(task_id, None, "todo", "task created"),
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Set canonical status when creating new tasks

add_task now records history as todo but still inserts into tasks without setting status, so upgraded databases that still have the legacy column default (pending) will create new rows as pending. Because claiming queries only select todo/ready (claim_next_task and claim_task), those newly created tasks become unclaimable until a later process restart reruns migration normalization. This is a production regression for existing DB files; write status='todo' on insert (or migrate the table default) to keep task state and queue selection consistent.

Useful? React with 👍 / 👎.

@Tweakzx Tweakzx changed the title feat: redesign task statuses and harden OpenClaw plugin defaults feat: redesign canonical task statuses and harden OpenClaw plugin defaults Apr 1, 2026
Copy link
Copy Markdown
Owner Author

@Tweakzx Tweakzx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@codex please check it again

@Tweakzx Tweakzx merged commit e7c7069 into main Apr 1, 2026
1 check passed
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