fix(workboard): hide archived cards in CLI list output by default#94865
fix(workboard): hide archived cards in CLI list output by default#94865lzyyzznl wants to merge 3 commits into
Conversation
- Add --include-archived flag to `workboard list` CLI command - Filter out archived cards (metadata.archivedAt) by default, matching the existing behavior of the workboard_list MCP tool and slash command - Add test coverage for default archived-card hiding and --include-archived Fixes openclaw#94555
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. Close as superseded: the Workboard CLI archive-listing bug is real, but this later branch duplicates the same fix while changing default JSON output; #94562 is the older proof-positive, maintainer-editable, JSON-preserving canonical landing path. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Canonical path: Land the JSON-preserving canonical Workboard CLI fix in #94562, then close the linked issue and duplicate same-root PRs after that fix merges. So I’m closing this here and keeping the remaining discussion on #94562. Review detailsBest possible solution: Land the JSON-preserving canonical Workboard CLI fix in #94562, then close the linked issue and duplicate same-root PRs after that fix merges. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection of current main shows terminal Is this the best way to solve the issue? No for this branch as the landing path. The CLI boundary is right, but filtering before Security review: Security review cleared: The diff changes Workboard CLI filtering and unit tests only; it adds no dependency, workflow, secret, package-resolution, install, or new 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 2609b9722280. |
- Fix eslint no-unused-vars warnings in cli.test.ts lines 158, 173, 188 - Rename const active -> _active in three test cases where the variable is declared but never referenced in assertions
…core-dangle lint - Replace `const _active =` with bare `await store.create()` since the return value is never used. The underscore prefix violated the oxlint no-underscore-dangle rule while the original active variable violated the no-unused-vars rule. Dropping the unused assignment satisfies both. Fixes openclaw#94555
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Closing as superseded per ClawSweeper review — duplicate of canonical PR #94562. |
Summary
The
openclaw workboard listCLI command prints all cards including archived ones, while the workboard_list MCP tool and the/workboard listslash command both hide archived cards by default (unlessincludeArchivedis explicitly set). This inconsistency causes users to believe archive operations failed when they still see archived cards in CLI output.This PR adds an
--include-archivedflag to theworkboard listCLI command and filters out cards withmetadata.archivedAtby default, matching the existing behavior of the tool and slash command paths. TheWorkboardStore.listmethod is left unchanged since callers own their visibility policy.Fixes #94555
Real behavior proof
Behavior addressed: The
openclaw workboard listCLI command displayed archived cards by default, inconsistent with the workboard_list API tool and slash command which hide archived cards unlessincludeArchivedis set.Real environment tested: Linux 6.8.0-124-generic, Node.js v22.12.0, pnpm v11.2.2, OpenClaw main @ dfc5bd5
Exact steps or command run after this patch: Run the workboard CLI tests:
cd ~/workspace/openclaw && node scripts/run-vitest.mjs extensions/workboard/src/cli.test.tsAfter-fix evidence: All 7 tests pass (3 existing + 4 new), see console output below.
All 7 tests pass, including the 4 new tests:
hides archived cards by default in list output— verifies archived cards are excluded from default text outputincludes archived cards with --include-archived flag— verifies--include-archivedrestores full visibilityhides archived cards in JSON output by default— verifies JSON output also respects the default filterObserved result after the fix: The
workboard listCLI command now hides archived cards by default. Passing--include-archivedmakes them visible again. The behavior is consistent with the workboard_list MCP tool (tools.ts) and the/workboard listslash command (command.ts), both of which already filter on!card.metadata?.archivedAtby default. TypeScript compilation passes with no errors.What was not tested: Live CLI end-to-end with an actual sqlite workboard database was not tested. The fix is verified through unit tests that exercise the same Commander.js action handler path used in production. The
WorkboardStore.archivemethod is called with the same code path as production, and the filter logic (!card.metadata?.archivedAt) matches the exact expression used in tools.ts:257 and command.ts:96.Tests and validation
Unit tests
New test cases added:
workboard listoutput contains only the active cardworkboard list --include-archivedshows both cardsTypeScript
Risk checklist
--include-archivedflag is additive; users who don't pass it will now get the consistent (and intended) default behavior of hiding archived cards. Users who previously relied on seeing archived cards can use--include-archivedto restore that behavior.--include-archivedflag is documented in the CLI help text via Commander.js.option(). The public CLI docs at docs.openclaw.ai/cli/workboard will need a corresponding update (out of scope for this PR, as docs are in a separate repository).Current review state