fix(workboard): filter archived cards from CLI list output#95468
fix(workboard): filter archived cards from CLI list output#95468maweibin wants to merge 6 commits into
Conversation
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. Close as duplicate/superseded: this is a sound JSON-preserving Workboard CLI fix, but the older open proof-positive PR at #94562 already owns the same bug and has no weaker landing signal. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Canonical path: Keep #94562 as the canonical JSON-preserving Workboard CLI fix, then close duplicate same-root PRs and the linked issue after the canonical path lands. So I’m closing this here and keeping the remaining discussion on #94562. Review detailsBest possible solution: Keep #94562 as the canonical JSON-preserving Workboard CLI fix, then close duplicate same-root PRs and the linked issue after the canonical path lands. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection shows current main and Is this the best way to solve the issue? No as the landing path. The implementation shape is good, but #94562 is the older open proof-positive canonical PR for the same issue. Security review: Security review cleared: Security review cleared: the diff is limited to Workboard CLI filtering, focused tests, and CLI docs with no dependency, workflow, secret, install, package, or code-execution surface. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against 654544b6b7c4. |
09bc5bc to
11a7864
Compare
069508a to
1853c24
Compare
The `openclaw workboard list` CLI command was returning all cards including archived ones, while `openclaw workboard` slash command and API tools already filter archived cards correctly. Added `--include-archived` flag (default false) to `list` command, with archive filtering before status filtering. - Problem: CLI `list` showed archived cards without opt-in flag - Solution: Added `--include-archived` option, filter by default - What changed: `cli.ts` (list handler filter), `cli.test.ts` (4 new tests) - What did NOT change: slash command, API tools, store.list() behavior Related to openclaw#94555 Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Previous approach filtered archived cards before writeCards, which also affected --json output (breaking machine contract backward compatibility). Canonical PR openclaw#94562 shows JSON output must preserve all cards by default; the archive filter only applies to human-readable text output. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
…ard compat Update docs/cli/workboard.md to document the new --include-archived flag, default archive filtering behavior, and JSON backward compatibility contract. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Two test cases declared `const active =` but never used the variable. Prefix with `_active` to satisfy eslint no-unused-vars rule. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
1853c24 to
73cbc6e
Compare
|
ClawSweeper applied the proposed close for this PR.
|
Summary
The
openclaw workboard listCLI command shows archived (soft-deleted) cards by default, inconsistent with theworkboard_listagent tool and/workboard listslash command which both hide them. This change filters archived cards from human-readable text output while preserving full-card JSON output for backward compatibility.listdefaults to showing archived cards while other entry points hide them--include-archivedflag; filterarchivedAtcards only in text mode; keep JSON output unchanged (machine contract backward compat)extensions/workboard/src/cli.ts(list handler + filter logic + inline comment),extensions/workboard/src/cli.test.ts(4 new tests),docs/cli/workboard.md(document --include-archived flag and JSON backward compat)WorkboardStore.list), slash command (command.ts), MCP tool (tools.ts), default JSON output behaviorChange Type (select all)
Scope (select all)
Linked Issue/PR
openclaw workboard listCLI does not filter archived cards (CLI/API inconsistency) #94555Motivation
The Workboard plugin has three entry points for listing cards: CLI (
workboard list), slash command (/workboard list), and MCP agent tool (workboard_list). The CLI was added after the other two and missed thearchivedAtfilter that both existing entry points apply by default. This inconsistency causes confusion: users see archived/"deleted" cards in CLI output without opting in.Real behavior proof
Behavior addressed: CLI
workboard listshows archived cards by default; fix hides them in text output while preserving JSON backward compat.Real environment tested: Linux, Node.js v24.13.1, branch
fix/workboard-archive-filter-94555from latestorigin/main(commit 7daba18)Exact steps or command run after this patch:
Evidence after fix:
The three commands above show:
listhides the archived card (only "Active test card" visible)--include-archivedshows both cards ("Archived proof card" restored)--jsonpreserves full card set includingarchivedAt(backward compatible)Unit test proof:
Behavior matrix (before vs after):
workboard listworkboard list --include-archivedworkboard list --jsonworkboard list --json --include-archivedObserved result after fix:
workboard listtext output filters out cards wheremetadata.archivedAtis set--include-archivedflag restores full listing including archived cards--jsonoutput preserves all cards by default (backward compatible — key differentiator from 8 closed competitor PRs)--json --include-archivedalso works as expectedWhat was not tested: Gateway dispatch scenario (not applicable — list is a read-only local command);
openclaw workboard listvia a remote gateway connectionRoot Cause
extensions/workboard/src/cli.ts:135— The CLIlisthandler was added without thearchivedAtfilter that already existed incommand.ts:97(/workboard listslash command) andtools.ts:257(workboard_listMCP tool). TheWorkboardStore.list()intentionally returns all cards unfiltered; each consumer is responsible for its own filtering.tools.ts:257(workboard_listMCP tool)61031d1b1c)command.ts:97(/workboard listslash)cli.ts:135(workboard listCLI)ed46e62bcc) — added 2 days later, missed the filterMade visible by: initial CLI implementation at
commands.ts→cli.tsmigration.Regression Test Plan
extensions/workboard/src/cli.test.ts--include-archivedshows archived cards--include-archivedshows archived cardsarchivedAtfield already proven incommand.tsandtools.tsUser-visible / Behavior Changes
workboard listtext output no longer shows archived cards--include-archivedflag available to show archived cards in text mode--jsonoutput unchanged (always returns all cards)docs/cli/workboard.mdupdated to document--include-archivedflag and JSON backward compatibilitySecurity Impact
Human Verification
--include-archivedshow, JSON backward compat, JSON +--include-archived, docs build and flag tableCompatibility / Migration
--include-archivedflag is additiveBest-fix Verdict
command.tsandtools.ts. JSON backward compat avoids breaking existing machine consumers. Theif (!options.json && !options.includeArchived)guard is the same architectural boundary used by the canonical fix fix(workboard): hide archived cards in CLI list by default #94562.writeCardsdirectly — rejected because it would affect all card output paths, not justlistAI Assistance
Risks and Mitigations
Highest risk area: Users or scripts that expect archived cards in default text output may be surprised by the change.
Mitigation:
--include-archivedflag provides an explicit escape hatchCompatibility: Additive change (
--include-archivedflag), no existing users broken unless they relied on (undocumented) behavior of archived cards appearing in default text output.Related to #94555