Skip to content

fix: send both state and state_id on work item create/update - #184

Open
nowjon wants to merge 1 commit into
makeplane:mainfrom
nowjon:fix/183-dual-state-fields
Open

fix: send both state and state_id on work item create/update#184
nowjon wants to merge 1 commit into
makeplane:mainfrom
nowjon:fix/183-dual-state-fields

Conversation

@nowjon

@nowjon nowjon commented Jul 20, 2026

Copy link
Copy Markdown

Summary

Context

This is the inverse of community fork fixes that renamed state_idstate alone (e.g. ZethicTech/plane-mcp-server#13). A single-direction rename breaks the other target; sending both avoids another silent-break cycle.

Test plan

  • uv run pytest tests/test_work_item_state_compat.py -v (5 passed)
  • uv run ruff check / ruff format --check on touched files
  • Verified on self-hosted Plane Community Edition (workspace homelab-ops):
    • PATCH with {state: <uuid>} only → HTTP 200, state unchanged
    • PATCH with dual payload from this fix {state: <uuid>, state_id: <uuid>} → state updates
    • Exercised the MCP update_work_item tool path in-process against the same CE instance; tool sent both fields and Plane applied the transition (then reverted for cleanup)
    • Deployed this branch into a live Hermes agent MCP venv; after recycling stale MCP stdio processes, state transitions via mcp__plane__update_work_item work on CE
  • Optional: against Plane Cloud, same call still transitions state

Self-hosted Plane CE ignores `state` and only applies `state_id`, while Cloud expects `state`. Mirroring both on create/update avoids silent no-ops (makeplane#183).

Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Work item create and update payloads now mirror state into state_id for Community Edition compatibility, with model serialization and MCP tool forwarding covered by tests.

Changes

Work item state compatibility

Layer / File(s) Summary
Compatibility payload contracts
plane_mcp/tools/work_items.py, tests/test_work_item_state_compat.py
Adds internal create/update payload models with optional state_id and verifies serialization with and without state values.
Create and update tool wiring
plane_mcp/tools/work_items.py, tests/test_work_item_state_compat.py
Uses the compatibility models, forwards state_id=state, documents the behavior, and verifies both fields reach the Plane client payload.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related issues

  • #183 — Adds the dual state and state_id payload behavior described by this issue.

Suggested reviewers: akhil-vamshi-konam

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: sending both state and state_id during work item create and update.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

Bug: update_work_item state is silently ignored on self-hosted CE (inverse of state_id→state rename)

1 participant