#4880·gastown

[Bug]: gt doctor --fix for lifecycle-hygiene can never succeed (gt mail delete lacks the --force it tells you to use)

Author: fschaefflerCreated Sep 22, 2026Updated Sep 22, 2026
Labelsstatus/needs-triage

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

gt doctor --fix's lifecycle-hygiene check reports the identical warning before and after --fix, with no error shown even under -v.

Root cause chain — internal/doctor/lifecycle_check.go, LifecycleHygieneCheck.Fix():

go
for _, msg := range c.staleMessages {
	cmd := exec.Command("gt", "mail", "delete", msg.ID)
	...
}
  1. Stale lifecycle messages live in deacon's inbox by definition (that's what checkDeaconInbox scans). gt mail delete <id> refuses when the caller isn't the message's assignee:
    $ gt mail delete hq-wisp-q34
    Error: hq-wisp-q34: cannot close hq-wisp-q34: assignee is "deacon/", actor is "mayor"; reclaim or use --force to override
    Since gt doctor --fix is normally run by an operator/mayor, not deacon itself, this is the common case, not an edge case.
  2. The suggested override doesn't exist:
    $ gt mail delete hq-wisp-q34 --force
    Error: unknown flag: --force
    gt mail delete --help confirms only -h/--help — no --force, no --identity. There's currently no CLI way to delete another identity's mail.
  3. Fix()'s error is swallowed somewhere before the CLI output — the check just re-reports the same warning, with no error surfaced even with -v. A silently-failed fix looks identical to a fix that was never attempted.

Expected Behavior

gt doctor --fix should actually clear stale lifecycle messages in deacon's inbox when run by any operator identity, and should surface an error if the fix genuinely fails.

SDK Version I encountered this issue in

gt version: dev (built from current main at time of report)

Steps To Reproduce

  1. Have a stale LIFECYCLE:-subject message in deacon's inbox.
  2. Run gt doctor as any identity other than deacon (e.g. mayor) — reports lifecycle-hygiene: Found N stale lifecycle message(s) in deacon inbox.
  3. Run gt doctor --fix — identical warning reported again, nothing changes.
  4. Run gt mail delete <id> directly — reproduces the assignee/actor mismatch error, confirming the root cause.

Filled out the Steps to Reproduce section?

  • I have entered valid steps to reproduce my issue or have attached a minimally reproducible case in code that shows my issue happening; and understand that without this my issue will be flagged as invalid and closed after 30 days.

Anything else?

Workaround found: bd close <id> --force on the underlying bead works and clears the check.

Suggested fix: either give gt mail delete the --force override its own error message already promises (and have Fix() use it), or have Fix() act with the deacon identity explicitly. Separately, Fix() errors should be surfaced in gt doctor --fix output rather than silently re-showing the original warning.

Tracked internally as gt-nkf.