Skip to content

feat(tasks): add chat-native task board#58828

Merged
vincentkoc merged 2 commits into
mainfrom
feat/tasks-slash
Apr 1, 2026
Merged

feat(tasks): add chat-native task board#58828
vincentkoc merged 2 commits into
mainfrom
feat/tasks-slash

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Apr 1, 2026

Copy link
Copy Markdown
Member

Summary

  • Problem: chat users had no dedicated /tasks command to inspect current background work without relying on the compact /status line.
  • Why it matters: long-running subagent, ACP, cron, and queued work was hard to inspect in-channel, especially when /status should stay compact.
  • What changed: added a chat-native /tasks command that shows current-session background tasks with recent details, and falls back to agent-local counts when the current session has no visible linked tasks.
  • What did NOT change (scope boundary): this does not implement true cross-session per-user aggregation yet; the task registry still uses session-scoped ownership semantics.

Change Type (select all)

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

Scope (select all touched areas)

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

Linked Issue/PR

Root Cause / Regression History (if applicable)

  • Root cause: N/A
  • Missing detection / guardrail: N/A
  • Prior context (git blame, prior PR, issue, or refactor if known): the new task registry already existed, but chat only exposed a compact /status summary.
  • Why this regressed now: N/A
  • If unknown, what was ruled out: owner-global task aggregation is still not available in the current registry model, so this PR intentionally stops at a session-local board.

Regression Test Plan (if applicable)

  • Coverage level that should have caught this:
    • Unit test
    • Seam / integration test
    • End-to-end test
    • Existing coverage already sufficient
  • Target test or file: src/auto-reply/reply/commands-tasks.test.ts
  • Scenario the test should lock in: /tasks shows current-session active/recent tasks, hides stale completed rows, and falls back to agent-local counts without leaking other-session task details.
  • Why this is the smallest reliable guardrail: the feature is pure chat-command rendering over the task registry snapshot.
  • Existing test that already covers this (if any): registry/help-copy tests cover command discovery only.
  • If no new test is added, why not: N/A

User-visible / Behavior Changes

  • Adds /tasks as a built-in chat command.
  • /tasks lists current-session background tasks with runtime, status, timing, and progress/error detail.
  • When the current session has no visible linked tasks, /tasks falls back to agent-local counts only.
  • Changelog entry included under Unreleased > Changes. Thanks @vincentkoc.

Diagram (if applicable)

Before:
[user asks /tasks] -> [no dedicated task board]

After:
[user asks /tasks] -> [session task snapshot] -> [detailed current-session tasks]
                                  \-> [agent-local counts fallback when session is empty]

Security Impact (required)

  • 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)
  • If any Yes, explain risk + mitigation: N/A

Repro + Verification

Environment

  • OS: macOS
  • Runtime/container: local worktree
  • Model/provider: N/A
  • Integration/channel (if any): chat /tasks
  • Relevant config (redacted): default local dev config

Steps

  1. Create running/queued/failed task-registry rows for the current session.
  2. Run /tasks through the chat command surface.
  3. Verify the command shows current-session tasks, hides stale completed rows, and falls back to agent-local counts when the session has none.

Expected

  • /tasks is available in command discovery and help.
  • Current-session tasks render with useful detail.
  • Other-session details are not leaked by the fallback.

Actual

  • Verified by targeted tests below.

Evidence

  • Failing test/log before + passing after
  • Trace/log snippets
  • Screenshot/recording
  • Perf numbers (if relevant)

Human Verification (required)

  • Verified scenarios: current-session active/recent task listing, stale-task filtering, agent-local count fallback, command registry/help wiring.
  • Edge cases checked: /tasks extra returns usage; fallback does not expose hidden task labels/details.
  • What you did not verify: live Slack/Discord/Telegram native command smoke.

Review Conversations

  • I replied to or resolved every bot review conversation I addressed in this PR.
  • I left unresolved only the conversations that still need reviewer or maintainer judgment.

Compatibility / Migration

  • Backward compatible? (Yes)
  • Config/env changes? (No)
  • Migration needed? (No)
  • If yes, exact upgrade steps: N/A

Risks and Mitigations

  • Risk: users may assume /tasks is already a global per-user board.
    • Mitigation: the current fallback is explicitly agent-local counts only, and the PR body calls out the remaining owner-global gap under #54226.

AI-assisted: yes. Local verification run.

@vincentkoc vincentkoc self-assigned this Apr 1, 2026
@openclaw-barnacle openclaw-barnacle Bot added size: M maintainer Maintainer-authored PR labels Apr 1, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review April 1, 2026 07:37
@greptile-apps

greptile-apps Bot commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds a /tasks chat-native command that exposes the current-session background task board to users in-chat, complementing the existing compact /status line. When the current session has visible tasks (active or recently terminal), it renders them with status icons, runtime labels, timing, and progress/error details. When the session has no visible tasks, it falls back to agent-local aggregate counts without leaking task labels or details from other sessions.

Key changes:

  • New commands-tasks.ts: Pure rendering logic over the existing TaskStatusSnapshot. Exports buildTasksText (sync), buildTasksReply (async wrapper resolving agentId), and handleTasksCommand (the actual command handler).
  • Command registry wiring in commands-registry.shared.ts and commands-handlers.runtime.ts: the tasks command is registered with category: "status" and a /tasks text alias.
  • Help text update in status.ts: /tasks appears in the Status section alongside /status, /whoami, /context.
  • Test coverage in commands-tasks.test.ts: covers active/recent listing, stale-task filtering (5-minute window), and the agent-local fallback isolation. No task details from other sessions are leaked in the fallback path.

The implementation is clean and consistent with existing command patterns. No P0 or P1 issues were found.

Confidence Score: 5/5

This PR is safe to merge — it adds an additive read-only chat command with no mutations and no cross-session data leakage.

All findings are P2 or lower. The core rendering logic correctly delegates to the existing TaskStatusSnapshot abstraction, the handler properly guards unauthorized senders, and the three targeted tests lock in the session-scoped visibility contract. No data mutations, no new network calls, no cross-session leakage.

No files require special attention.

Reviews (1): Last reviewed commit: "Merge branch 'main' into feat/tasks-slas..." | Re-trigger Greptile

@vincentkoc
vincentkoc merged commit facdeb3 into main Apr 1, 2026
39 of 44 checks passed
@vincentkoc
vincentkoc deleted the feat/tasks-slash branch April 1, 2026 07:48
steipete pushed a commit to Mlightsnow/openclaw that referenced this pull request Apr 1, 2026
lovewanwan pushed a commit to lovewanwan/openclaw that referenced this pull request Apr 28, 2026
ogt-redknie pushed a commit to ogt-redknie/OPENX that referenced this pull request May 2, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 9, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 24, 2026
Nachx639 pushed a commit to Nachx639/clawdbot that referenced this pull request Jun 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: /tasks command — User-facing task status dashboard via IM channels

1 participant