Skip to content

feat(c0mpute): task states in /agents and /tasks, plus & background tasks - #605

Merged
ralyodio merged 1 commit into
mainfrom
feat/c0mpute-task-states
Nov 9, 2026
Merged

ralyodio merged 1 commit into
mainfrom
feat/c0mpute-task-states

Conversation

@ralyodio

@ralyodio ralyodio commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

/agents claude opens Claude Code's agents view, where every task is Working, Needs input, Completed or Failed. /agents c0mpute had no task list at all: one blocking turn at a time. This gives it the same states.

What changes

  • Task board (src/c0agent-tasks.mjs): every turn is a task in one of Needs input · Working · Completed · Failed · Stopped. It is saved to ~/.moshcode/c0mpute-tasks.json and merged across sessions. A live task whose process died reads as Stopped.
  • Background tasks: & [@agent] <task> (or /bg) runs one without blocking the prompt. Its permission prompts park it as Needs input, announced above the prompt; /tasks <id> shows the log and result, and answers the prompt. The prompt shows [1 working · 1 needs input] while tasks run, and /exit warns once before stopping them.
  • /agents lists tasks by state above the agent definitions. /tasks, /tasks stop <id> and /tasks clear manage them.
  • CLI: moshcode agents c0mpute tasks [clear].

Tested

  • test/c0agent-tasks.test.mjs: state transitions, grouping/order, cross-session merge plus dead-pid → Stopped, the CLI verb and parseArgs.
  • Live pty run against c0mpute: & … → [1 working] prompt, /tasks and /agents show it under Working with live node status ("bonita has the job…"), and /exit warns.
  • Full node --test: 3 failures locally, all outside this change (apps/pwa deps aren't installed locally, plus install-dependencies).

🤖 Generated with Claude Code

…asks

`moshcode agents c0mpute` now tracks every turn as a task with Claude Code's
agents-view states: Needs input, Working, Completed, Failed, Stopped.

- `& [@agent] <task>` (or /bg) runs a task in the background; a permission
  prompt parks it as Needs input instead of grabbing the prompt, and
  `/tasks <id>` shows it and answers. Transitions are announced above the
  prompt, which shows `[1 working · 1 needs input]` while any run.
- `/agents` lists tasks by state above the agent definitions; `/tasks`,
  `/tasks stop <id>`, `/tasks clear`.
- The board is mirrored to ~/.moshcode/c0mpute-tasks.json so
  `moshcode agents c0mpute tasks` and other sessions see it; a live task
  whose process died reads as Stopped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown

ThreatCrush Security Scan

0 finding(s) in the 3 file(s) this pull request changes.

Nothing in the files this pull request changes.

125 pre-existing finding(s) elsewhere in the repository — **HIGH/CRITICAL**: 8 | **MEDIUM**: 87 | **LOW**: 30

Not introduced by this pull request. The full set is in the Security tab.

Severity Rule Location
HIGH js-ssrf-outbound-request apps/pwa/public/sw.js:76
HIGH tls-verification-disabled apps/pwa/src/lib/moshpit-gateway.mjs:299
HIGH sh-remote-script-execution install.sh:87
HIGH sh-remote-script-execution install.sh:91
HIGH sh-remote-script-execution install.sh:259
HIGH sh-remote-script-execution install.sh:270
HIGH sh-remote-script-execution install.sh:276
HIGH tls-verification-disabled src/dns.mjs:823
MEDIUM js-unescaped-html-sink apps/pwa/public/herd/herd.js:117
MEDIUM sql-template-interpolation apps/pwa/src/lib/moshpit-certs.mjs:56
MEDIUM sql-template-interpolation apps/pwa/src/lib/moshpit-certs.mjs:117
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:140
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:154
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:180
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:374
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:378
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:423
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:707
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:909
MEDIUM sql-template-interpolation apps/pwa/src/moshpit.mjs:911

…and 105 more. Full results in the Security tab.

Snippets are redacted; ThreatCrush never prints matched credential material.

@ralyodio
ralyodio merged commit 31160b9 into main Nov 9, 2026
6 checks passed
@ralyodio
ralyodio deleted the feat/c0mpute-task-states branch November 9, 2026 12:38
@ralyodio ralyodio mentioned this pull request Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant