Skip to content

fix(workboard): filter archived cards from CLI list output#95468

Closed
maweibin wants to merge 6 commits into
openclaw:mainfrom
maweibin:fix/workboard-archive-filter-94555
Closed

fix(workboard): filter archived cards from CLI list output#95468
maweibin wants to merge 6 commits into
openclaw:mainfrom
maweibin:fix/workboard-archive-filter-94555

Conversation

@maweibin

@maweibin maweibin commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Summary

The openclaw workboard list CLI command shows archived (soft-deleted) cards by default, inconsistent with the workboard_list agent tool and /workboard list slash command which both hide them. This change filters archived cards from human-readable text output while preserving full-card JSON output for backward compatibility.

  • Problem: CLI list defaults to showing archived cards while other entry points hide them
  • Solution: Add --include-archived flag; filter archivedAt cards only in text mode; keep JSON output unchanged (machine contract backward compat)
  • What changed: 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)
  • What did NOT change: store layer (WorkboardStore.list), slash command (command.ts), MCP tool (tools.ts), default JSON output behavior

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor required for the fix
  • Docs
  • Security hardening
  • Chore/infra

Scope (select all)

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • Integrations
  • API / contracts
  • UI / DX
  • CI/CD / infra

Linked Issue/PR

Motivation

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 the archivedAt filter 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 list shows 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-94555 from latest origin/main (commit 7daba18)

Exact steps or command run after this patch:

# 1. Real CLI proof: list cards with --board filter
pnpm openclaw workboard list --board cli-proof
pnpm openclaw workboard list --board cli-proof --include-archived
pnpm openclaw workboard list --board cli-proof --json

# 2. Unit test proof
node scripts/run-vitest.mjs extensions/workboard/src/cli.test.ts --run --reporter=verbose

Evidence after fix:

$ pnpm openclaw workboard list --board cli-proof
866f0f06  todo      normal  cli-proof  Active test card

$ pnpm openclaw workboard list --board cli-proof --include-archived
866f0f06  todo      normal  cli-proof  Active test card
20ae476c  todo      normal  cli-proof  Archived proof card

$ pnpm openclaw workboard list --board cli-proof --json | grep -E "title|archivedAt"
      "title": "Active test card",
      "title": "Archived proof card",
        "archivedAt": 1782010944377,

The three commands above show:

  1. Default list hides the archived card (only "Active test card" visible)
  2. --include-archived shows both cards ("Archived proof card" restored)
  3. --json preserves full card set including archivedAt (backward compatible)

Unit test proof:

$ node scripts/run-vitest.mjs extensions/workboard/src/cli.test.ts --run --reporter=verbose
[test] starting test/vitest/vitest.extensions.config.ts

 RUN  v4.1.8 /home/0668000787/project/open-claw-github/openclaw

 ✓ |extensions| extensions/workboard/src/cli.test.ts > registerWorkboardCli > redacts claim tokens from card JSON output
 ✓ |extensions| extensions/workboard/src/cli.test.ts > registerWorkboardCli > does not fall back to local dispatch for explicit gateway targets
 ✓ |extensions| extensions/workboard/src/cli.test.ts > registerWorkboardCli > does not fall back to local dispatch for configured remote gateways
 ✓ |extensions| extensions/workboard/src/cli.test.ts > registerWorkboardCli > rejects ambiguous card id prefixes
 ✓ |extensions| extensions/workboard/src/cli.test.ts > registerWorkboardCli > hides archived cards from workboard list by default
 ✓ |extensions| extensions/workboard/src/cli.test.ts > registerWorkboardCli > shows archived cards with --include-archived flag
 ✓ |extensions| extensions/workboard/src/cli.test.ts > registerWorkboardCli > preserves archived cards in JSON output by default
 ✓ |extensions| extensions/workboard/src/cli.test.ts > registerWorkboardCli > shows archived cards in JSON output with --include-archived

 Test Files  1 passed (1)
      Tests  8 passed (8)

Behavior matrix (before vs after):

Command Before (unfixed) After (this PR)
workboard list shows archived cards hides archived cards
workboard list --include-archived N/A (no flag) shows archived cards
workboard list --json shows archived cards shows archived cards (unchanged)
workboard list --json --include-archived N/A (no flag) shows archived cards

Observed result after fix:

  1. Default workboard list text output filters out cards where metadata.archivedAt is set
  2. --include-archived flag restores full listing including archived cards
  3. --json output preserves all cards by default (backward compatible — key differentiator from 8 closed competitor PRs)
  4. --json --include-archived also works as expected
  5. All 4 existing tests continue to pass

What was not tested: Gateway dispatch scenario (not applicable — list is a read-only local command); openclaw workboard list via a remote gateway connection

Root Cause

extensions/workboard/src/cli.ts:135 — The CLI list handler was added without the archivedAt filter that already existed in command.ts:97 (/workboard list slash command) and tools.ts:257 (workboard_list MCP tool). The WorkboardStore.list() intentionally returns all cards unfiltered; each consumer is responsible for its own filtering.

File Filter present? Added
tools.ts:257 (workboard_list MCP tool) Yes 2026-05-29 (61031d1b1c)
command.ts:97 (/workboard list slash) Yes Initial implementation
cli.ts:135 (workboard list CLI) No (before this PR) 2026-05-31 (ed46e62bcc) — added 2 days later, missed the filter

Made visible by: initial CLI implementation at commands.tscli.ts migration.

Regression Test Plan

  • Target: extensions/workboard/src/cli.test.ts
  • Coverage: 4 new test cases:
    • Text default hides archived cards
    • --include-archived shows archived cards
    • JSON preserves archived cards by default (backward compat)
    • JSON + --include-archived shows archived cards
  • Rationale: Minimal proof surface — the fix is a single filter predicate in one handler, using the same pattern and same archivedAt field already proven in command.ts and tools.ts

User-visible / Behavior Changes

  • Default workboard list text output no longer shows archived cards
  • New --include-archived flag available to show archived cards in text mode
  • --json output unchanged (always returns all cards)
  • docs/cli/workboard.md updated to document --include-archived flag and JSON backward compatibility

Security Impact

  • New permissions/capabilities? No
  • Secrets/tokens handling changed? No
  • New/changed network calls? No
  • Command/tool execution surface changed? No
  • Data access scope changed? No

Human Verification

  • Verified scenarios: Text default hide, --include-archived show, JSON backward compat, JSON + --include-archived, docs build and flag table
  • Edge cases checked: Only text output is filtered (JSON preserved); filter applied after status filter (correct ordering)

Compatibility / Migration

  • Backward compatible? Yes — JSON output unchanged, --include-archived flag is additive
  • Config/env changes? No
  • Migration needed? No

Best-fix Verdict

  • Best fix: Yes — aligns CLI with the same filter pattern and field already proven in command.ts and tools.ts. JSON backward compat avoids breaking existing machine consumers. The if (!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.
  • Refactor needed: No — this is a bounded one-predicate addition to a single handler
  • Alternative considered: Filtering in writeCards directly — rejected because it would affect all card output paths, not just list

AI Assistance

  • AI-assisted: Yes
  • Co-Authored-By: Claude Sonnet 4.6 [email protected]
  • Human confirmed understanding of code changes: Yes
  • AI prompts / session excerpts: Internal conversation transcript available

Risks and Mitigations

Highest risk area: Users or scripts that expect archived cards in default text output may be surprised by the change.

Mitigation:

  • The --include-archived flag provides an explicit escape hatch
  • JSON output is preserved for existing automation
  • This change mirrors the already-shipped behavior in the slash command and MCP tool, making the three entry points consistent
  • Note: 8 previous competitor PRs were closed for changing default JSON output — this PR explicitly preserves it

Compatibility: Additive change (--include-archived flag), no existing users broken unless they relied on (undocumented) behavior of archived cards appearing in default text output.


Related to #94555

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation plugin: workboard size: S labels Jun 21, 2026
@clawsweeper

clawsweeper Bot commented Jun 21, 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 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
Relationship: superseded
Canonical: #94562
Summary: This PR and the canonical PR target the same Workboard CLI archived-card visibility mismatch; the canonical PR is older, open, clean, proof-positive, and implements the same JSON-preserving fix shape.

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 details

Best 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 v2026.6.9 list all Workboard CLI cards except optional status filtering, while the Workboard tool and slash command hide archived cards by default.

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:

  • steipete: Authored the merged Workboard agent tools and worker dispatch CLI work that introduced the relevant tool, slash-command, CLI, docs, and test surfaces. (role: feature-history owner; confidence: high; commits: 61031d1b1cec, ed46e62bcc5d; files: extensions/workboard/src/cli.ts, extensions/workboard/src/tools.ts, extensions/workboard/src/command.ts)
  • vincentkoc: Current-main blame attributes the present Workboard file snapshots to a recent grafted commit by this account, and the latest branch cleanup commits on this PR are also by this account. (role: recent area contributor; confidence: medium; commits: fa263affd584, 73cbc6e461fb; files: extensions/workboard/src/cli.ts, extensions/workboard/src/tools.ts, extensions/workboard/src/command.ts)
  • ZengWen-DT: Authored the older open canonical candidate PR for the same Workboard CLI archived-card issue with proof, docs, tests, and JSON-preserving behavior. (role: canonical candidate author; confidence: high; commits: 1c0991aca46d, 66ba5f43be9d; 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 654544b6b7c4.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Jun 21, 2026
@vincentkoc vincentkoc self-assigned this Jun 23, 2026
@vincentkoc
vincentkoc force-pushed the fix/workboard-archive-filter-94555 branch 7 times, most recently from 09bc5bc to 11a7864 Compare June 23, 2026 11:29
@vincentkoc
vincentkoc requested a review from a team as a code owner June 23, 2026 14:42
@openclaw-barnacle openclaw-barnacle Bot added channel: nextcloud-talk Channel integration: nextcloud-talk channel: telegram Channel integration: telegram gateway Gateway runtime extensions: memory-core Extension: memory-core scripts Repository scripts docker Docker and sandbox tooling agents Agent runtime and tooling extensions: acpx extensions: kilocode labels Jun 23, 2026
maweibin and others added 6 commits June 23, 2026 23:48
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]>
@vincentkoc
vincentkoc force-pushed the fix/workboard-archive-filter-94555 branch from 1853c24 to 73cbc6e Compare June 23, 2026 15:48
@clawsweeper

clawsweeper Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper applied the proposed close for this PR.

  • Action: closed this PR.
  • Close reason: duplicate or superseded.
  • Evidence: durable ClawSweeper review.
  • Coverage proof: PR B clearly carries PR A's core useful behavior and review concerns and is identified as the older canonical proof-positive landing candidate for the same JSON-preserving Workboard CLI archived-card fix; any remaining PR A details are incidental or reviewable on PR B. Covering PR: fix(workboard): hide archived cards in CLI list by default #94562.

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

Labels

docs Improvements or additions to documentation merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. plugin: workboard proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants