Skip to content

fix(incident): rename --channel to --channel-id on incident list#43

Merged
ysyneu merged 2 commits into
feat/ai-srefrom
audit-fix/audit-2026-06-15-incident-list-channel-id
Jun 15, 2026
Merged

fix(incident): rename --channel to --channel-id on incident list#43
ysyneu merged 2 commits into
feat/ai-srefrom
audit-fix/audit-2026-06-15-incident-list-channel-id

Conversation

@ysyneu

@ysyneu ysyneu commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

What

fduty incident list used --channel, but every sibling channel command uses --channel-id (e.g. channel info --channel-id, channel escalate-rule-list --channel-id). This renames the flag to --channel-id for consistency.

--channel is removed, not aliased — only --channel-id exists on incident list. It filters by channel id and forwards to /incident/list as channel_ids.

Root cause

From prod audit run audit-2026-06-15 (session sess_KtAQ9DLCeiEXVbnTYcfGzw, step 25): an ai-sre agent ran fduty incident list --channel-id <id> and got unknown flag: --channel-id; the working flag was the inconsistently-named --channel. Agents transfer flag knowledge across command groups, so a name that disagrees with the sibling channel commands forces a wasted trial-and-error turn. Precedent: cli PR #41 (incident-list flag doc-vs-code drift) and PR #42 (member list --limit consistency).

Verification

$ env -u GOROOT go build ./...            # clean
$ env -u GOROOT go test ./...             # all packages ok
ok  github.com/flashcatcloud/flashduty-cli/cmd/flashduty   3.667s
ok  github.com/flashcatcloud/flashduty-cli/internal/cli    0.434s
ok  github.com/flashcatcloud/flashduty-cli/internal/config 1.442s
ok  github.com/flashcatcloud/flashduty-cli/internal/output 0.598s
ok  github.com/flashcatcloud/flashduty-cli/internal/timeutil 0.889s
ok  github.com/flashcatcloud/flashduty-cli/internal/update 1.178s

$ gofmt -l internal/cli/incident.go internal/cli/incident_test.go   # clean

# test
--- PASS: TestCommandIncidentListChannelIDFlag   # --channel-id 123 -> channel_ids:[123]

# built binary
$ flashduty incident list --help            # shows: --channel-id int   Filter by channel ID
$ flashduty incident list --channel-id 123  # parses, no "unknown flag"
$ flashduty incident list --channel 123     # Error: unknown flag: --channel   (fully removed)

ysyneu added 2 commits June 15, 2026 11:47
`incident list` only accepted --channel, but every sibling channel command
(channel info --channel-id, channel escalate-rule-list --channel-id, ...)
uses --channel-id. An ai-sre agent that transferred the flag name across
commands ran `incident list --channel-id <id>` and got "unknown flag",
wasting a turn.

Make --channel-id the canonical flag (matching the siblings) and keep
--channel as a deprecated alias bound to the same variable so existing
callers keep working. Add tests asserting both flags forward to
/incident/list as channel_ids.
`incident list` used --channel while every sibling channel command uses
--channel-id (channel info --channel-id, channel escalate-rule-list
--channel-id, ...). Rename the flag to --channel-id for consistency.
--channel is removed (not aliased); only --channel-id exists.
@ysyneu ysyneu changed the title fix(incident): accept --channel-id on incident list for flag consistency fix(incident): rename --channel to --channel-id on incident list Jun 15, 2026
@ysyneu ysyneu merged commit 6c2d053 into feat/ai-sre Jun 15, 2026
12 checks passed
@ysyneu ysyneu deleted the audit-fix/audit-2026-06-15-incident-list-channel-id branch June 15, 2026 05:14
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