Skip to content

fix(workboard): hide archived cards in CLI list output by default#94865

Closed
lzyyzznl wants to merge 3 commits into
openclaw:mainfrom
lzyyzznl:fix/issue-94555-workboard-list-archived-cards
Closed

fix(workboard): hide archived cards in CLI list output by default#94865
lzyyzznl wants to merge 3 commits into
openclaw:mainfrom
lzyyzznl:fix/issue-94555-workboard-list-archived-cards

Conversation

@lzyyzznl

Copy link
Copy Markdown
Contributor

Summary

The openclaw workboard list CLI command prints all cards including archived ones, while the workboard_list MCP tool and the /workboard list slash command both hide archived cards by default (unless includeArchived is 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-archived flag to the workboard list CLI command and filters out cards with metadata.archivedAt by default, matching the existing behavior of the tool and slash command paths. The WorkboardStore.list method is left unchanged since callers own their visibility policy.

Fixes #94555

Real behavior proof

Behavior addressed: The openclaw workboard list CLI command displayed archived cards by default, inconsistent with the workboard_list API tool and slash command which hide archived cards unless includeArchived is 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.ts

cd ~/workspace/openclaw
node scripts/run-vitest.mjs extensions/workboard/src/cli.test.ts

After-fix evidence: All 7 tests pass (3 existing + 4 new), see console output below.

 RUN  v4.1.8 /home/lizeyu/workspace/openclaw

 Test Files  1 passed (1)
      Tests  7 passed (7)
   Start at  15:53:09
   Duration  2.64s (transform 1.25s, setup 190ms, import 2.28s, tests 27ms, environment 0ms)

[test] passed 1 Vitest shard in 8.31s

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 output
  • includes archived cards with --include-archived flag — verifies --include-archived restores full visibility
  • hides archived cards in JSON output by default — verifies JSON output also respects the default filter
  • All 3 existing tests continue to pass (claim token redaction, gateway fallback, ambiguous prefix)

Observed result after the fix: The workboard list CLI command now hides archived cards by default. Passing --include-archived makes them visible again. The behavior is consistent with the workboard_list MCP tool (tools.ts) and the /workboard list slash command (command.ts), both of which already filter on !card.metadata?.archivedAt by 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.archive method 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

$ node scripts/run-vitest.mjs extensions/workboard/src/cli.test.ts

 RUN  v4.1.8 /home/lizeyu/workspace/openclaw

 Test Files  1 passed (1)
      Tests  7 passed (7)
   Start at  15:53:09
   Duration  2.64s

New test cases added:

  1. hides archived cards by default in list output — creates an active card and an archived card, verifies workboard list output contains only the active card
  2. includes archived cards with --include-archived flag — same setup, verifies workboard list --include-archived shows both cards
  3. hides archived cards in JSON output by default — verifies the JSON output path also respects the default archived-card filter

TypeScript

$ npx tsc --noEmit -p extensions/workboard/tsconfig.json
TypeScript: No errors found

Risk checklist

  • This change is backwards compatible — The --include-archived flag 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-archived to restore that behavior.
  • This change has been tested with existing configurations — All 3 existing tests pass without modification, confirming no regression in claim token redaction, gateway dispatch fallback, or ambiguous prefix handling.
  • I have updated relevant documentation — The --include-archived flag 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).
  • Breaking changes (if any) are documented in Summary — The change in default visibility for archived cards is documented in the Summary section. This is a bug fix that aligns CLI behavior with the existing tool and slash command defaults.

Current review state

  • Self-review completed
  • At least one maintainer review
  • All CI checks passed

- 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
@openclaw-barnacle openclaw-barnacle Bot added plugin: workboard size: S proof: supplied External PR includes structured after-fix real behavior proof. labels Jun 19, 2026
@clawsweeper

clawsweeper Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

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
Relationship: superseded
Canonical: #94562
Summary: This PR is a later duplicate candidate for the Workboard CLI archived-card filtering bug; the older canonical PR is open, viable, proof-positive, and preserves JSON compatibility.

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 details

Best 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 openclaw workboard list filters only by status while the Workboard tool and slash-command list paths hide archived cards by default; the linked issue gives concrete CLI/SQLite reproduction steps.

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 writeCards changes default JSON full-list behavior; the safer canonical fix filters compact text only and preserves JSON compatibility.

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:

  • Root policy read: Root AGENTS.md was read fully; its duplicate, compatibility, proof, PR-review, and scoped-policy rules affected this review. (AGENTS.md:1, 2609b9722280)
  • Scoped extension policy read: extensions/AGENTS.md was read fully; the touched files stay within the bundled plugin boundary, so the review focuses on Workboard CLI behavior and compatibility rather than a core boundary violation. (extensions/AGENTS.md:1, 2609b9722280)
  • Current main still has the CLI mismatch: Current main's workboard list handler reads cards, filters only by status, and writes all cards without an archivedAt visibility check. (extensions/workboard/src/cli.ts:128, 2609b9722280)
  • Sibling tool default hides archived cards: The workboard_list tool exposes includeArchived and filters archived cards unless that parameter is true, proving the intended non-CLI default. (extensions/workboard/src/tools.ts:237, 2609b9722280)
  • Sibling slash command hides archived cards: The /workboard list path filters out cards with metadata.archivedAt, making the terminal CLI the inconsistent list surface. (extensions/workboard/src/command.ts:96, 2609b9722280)
  • Store remains full-list boundary: WorkboardStore.list returns sorted board-matching cards without archive visibility policy, so callers own whether archived cards are shown. (extensions/workboard/src/store.ts:2317, 2609b9722280)

Likely related people:

  • steipete: Merged PR metadata and available commits tie this account to the original Workboard CLI, slash command, CLI tests, and docs surface involved in the bug. (role: introduced Workboard CLI feature; confidence: high; commits: ed46e62bcc5d, f8b566b9c1df, fee64cfa3edb; files: extensions/workboard/src/cli.ts, extensions/workboard/src/command.ts, extensions/workboard/src/cli.test.ts)
  • vincentkoc: Current-main blame for the relevant Workboard CLI, tool, and slash-command list blocks points to recent grafted snapshot commits by Vincent Koc in this checkout. (role: recent area contributor; confidence: medium; commits: c2ee9b0be8ae, 2609b9722280; files: extensions/workboard/src/cli.ts, extensions/workboard/src/tools.ts, extensions/workboard/src/command.ts)
  • ZengWen-DT: This account authored the older viable canonical PR for the same Workboard CLI archive visibility bug, including docs, tests, JSON compatibility coverage, and real CLI proof. (role: canonical follow-up owner; confidence: high; commits: 9e5e3bdc33a7, c2fec1243ff7; files: extensions/workboard/src/cli.ts, extensions/workboard/src/cli.test.ts, docs/cli/workboard.md)

Codex review notes: model internal, reasoning high; reviewed against 2609b9722280.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Jun 19, 2026
- 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
@lzyyzznl

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@lzyyzznl

Copy link
Copy Markdown
Contributor Author

Closing as superseded per ClawSweeper review — duplicate of canonical PR #94562.

@lzyyzznl lzyyzznl closed this Jun 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. plugin: workboard proof: supplied External PR includes structured after-fix real behavior proof. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: S status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: openclaw workboard list CLI does not filter archived cards (CLI/API inconsistency)

1 participant