Skip to content

pm update no-op reports phantom changed_fields in --json (and changed_field_count is null) #534

Closed

Description

@unbraind

Summary

For a no-op `pm update` (setting a field to its current value), the JSON output incorrectly reports the field in `changed_fields`, while the TOON output reports an empty `changed_fields`. The two output formats disagree about what changed. Additionally, `changed_field_count` is always `null` in --json output (the CLI computes it for TOON but never populates it in the JSON object).

Steps to reproduce

```bash
pm init --path /tmp/t && cd /tmp/t
ID=$(pm create --type Task --title t --path /tmp/t | grep -o 'pm-[a-z0-9]*' | head -1)

no-op: set title to its existing value

pm update $ID --title t --json --path /tmp/t | python3 -c "import sys,json;d=json.load(sys.stdin);print('changed_fields=',d.get('changed_fields'));print('changed_field_count=',d.get('changed_field_count'))"

-> changed_fields= ['title'] (phantom) ; changed_field_count= None

pm update $ID --title t --path /tmp/t # TOON: "changed_fields:" with empty list
```

Expected

  • A no-op update should report an empty `changed_fields` in BOTH formats (or the TOON empty behavior is correct and JSON should match).
  • `changed_field_count` should be a number (e.g. 0 for no-op, 1 for a real change) in --json output, not `null`.

Actual

  • JSON reports `changed_fields: ['title']` for an unchanged value (phantom change); TOON reports empty.
  • `changed_field_count` is `null` in JSON regardless of whether a field actually changed.

Impact

Agents/CI that branch on `changed_fields` or `changed_field_count` from --json output are misled into thinking a change occurred when it did not, and cannot reliably count changes.

Environment

pm version: 2026.7.12, OS: linux, node: v25.9.0

Suspected area

`update` command mutation result serialization (changed_fields diffing + changed_field_count population in JSON mode).

Activity

  1. coderabbitai commented on Jul 13, 2026

    @coderabbitai
    🔗 Related PRs

    #40 - Never block agents: close-via-update, semantic fallback, create form, calendar --date crash [closed]
    #41 - perf: drop zod from settings hot path (~38% faster) + unblock auto daily release [closed]
    #146 - fix: agent never-block reliability, MCP/version coherence, and CI/docs hardening [closed]
    #413 - Refactor update mutation complexity [merged]
    #481 - Expose SDK context primitives and closed_at metadata [merged]


    📝 Issue Planner

    Check the box below or use the @coderabbitai plan command to generate an implementation plan and prompts that you can use with your favorite coding assistant.

    • Create Plan

    🧪 Issue enrichment is currently in open beta.

    You can configure auto-planning by selecting labels in the issue_enrichment configuration.

    To disable automatic issue enrichment, add the following to your .coderabbit.yaml:

    issue_enrichment:
      auto_enrich:
        enabled: false

    💬 Have feedback or questions? Drop into our discord!

  2. unbraind commented on Jul 13, 2026

    @unbraind
    OwnerAuthor

    pm tracker item: pm-45mb

  3. added a commit that references this issue on Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions