Repository navigation
feat(cli): claim, release, complete and report progress on shared tasks - #196
Conversation
harshsaver
left a comment
There was a problem hiding this comment.
🤖 Agentbox PR audit: changes requested
What needs to change
Please apply the fix plan above.
n/a
What this PR changes
- What it does: Lets a terminal agent take a shared task, hand it back, post progress, notes or blockers, read progress history, and finish the task with an optional completion note.
- What changes in the product: Five new terminal commands and a shared-task walkthrough. Adding and listing tasks also starts working inside a shell opened by the agent launcher. No web screens or server ownership rules change.
- Why it exists: Issue #179 asks for terminal agents to finish the shared-task workflow without writing their own web requests.
- Why merge (or why not yet): The commands reuse the existing task operations and preserve task ownership. Before merge, let owners read full progress history, consolidate the duplicated input helper, and explain that posting progress also requires holding the task.
- What to expect after merging: Connected agents can perform the full workflow. Owners can create tasks and inspect their history; claiming and updating work still require an agent session. File and piped text retain trailing line breaks. Completion notes remain visible through machine-readable task output but are absent from the ordinary task listing, a pre-existing follow-up.
Full audit (Claude (fable, xhigh) × Codex (gpt-6-astra, xhigh), 2 turns, commit 6479697)
PR audit: #196 — feat(cli): claim, release, complete and report progress on shared tasks
Head: 6479697
Sign-off
- Claude (fable, xhigh): ✅ satisfied — sound, well-tested PR; three small gaps we can fix ourselves on the branch before merge.
- Codex (gpt-6-astra, xhigh): ✅ satisfied — independently verified all three findings and the fix plan; no additional blocking issue or material change.
Decision
fix — the task workflow works, but owner access to progress history, duplicated text-input handling, and an incomplete ownership explanation need small, mechanical fixes before merge.
What changes (plain language)
- What it does: Lets a terminal agent take a shared task, hand it back, post progress, notes or blockers, read progress history, and finish the task with an optional completion note.
- What changes in the product: Five new terminal commands and a shared-task walkthrough. Adding and listing tasks also starts working inside a shell opened by the agent launcher. No web screens or server ownership rules change.
- Why it exists: Issue #179 asks for terminal agents to finish the shared-task workflow without writing their own web requests.
- Why merge (or why not yet): The commands reuse the existing task operations and preserve task ownership. Before merge, let owners read full progress history, consolidate the duplicated input helper, and explain that posting progress also requires holding the task.
- What to expect after merging: Connected agents can perform the full workflow. Owners can create tasks and inspect their history; claiming and updating work still require an agent session. File and piped text retain trailing line breaks. Completion notes remain visible through machine-readable task output but are absent from the ordinary task listing, a pre-existing follow-up.
Findings
Blocking
All three are small and we can fix them ourselves; none needs the author.
-
cmd/agentintercom/task_lifecycle.go:166—task progress listrefuses the workspace owner.- It uses
executionClient, so a shell holding onlyOCTOBER_BUS_SCOPE_TOKENgets “this command needs a connected session: OCTOBER_BUS_AGENT_TOKEN is not set” (cmd/agentintercom/message.go:27). - The server explicitly accepts either credential for this read:
bus/runtime.go:515callstaskAuthority(bus/runtime.go:573), andspec/0.1/http.md:78documents “Scope or agent.” Existing coverage and clients agree:bus/task_progress_test.go:37,conformance/runner.go:501, andsdk/typescript/src/client.ts:269. - The PR already adds
taskClientfor routes accepting either credential (cmd/agentintercom/task_lifecycle.go:195) and applies it to task creation and listing (cmd/agentintercom/main.go:693,:729). - User impact: the owner workflow in
docs/operations.md:116can inspect tasks and their latest 20 progress entries (bus/task_progress.go:13,:46), but cannot use the dedicated command to read older entries. - Issue #179 requires execution credentials for agent mutations. Allowing this read follows the existing contract and does not change ownership.
- It uses
-
cmd/agentintercom/task_lifecycle.go:209—taskTextduplicatesmessageBody(cmd/agentintercom/message.go:45).- Both implement inline input versus a file,
-for stdin, a bounded read, and size/empty checks. - Under Harsh’s simplicity and reuse rules, one helper should serve messages, channel posts, and task text. The PR’s helper already has the parameters needed; no additional abstraction or dependency is necessary.
- Replacing
messageBodywith that helper preserves accepted message/channel input and the 65536-byte limit. Only validation-error wording changes. - Repository searches found no test or documentation depending on the old combined error text at
message.go:65.
- Both implement inline input versus a file,
-
docs/cli-messages.md:73— the ownership explanation omits progress updates.- It says only the claiming execution can release or complete a task. Adding progress has the same restriction (
bus/task_progress.go:96,spec/0.1/http.md:77). - A reader trying to post a note or blocker before claiming the task receives a conflict that this explanation does not cover.
- The credential sentence must also include
task progress listwhen finding 1 is fixed.
- It says only the claiming execution can release or complete a task. Adding progress has the same restriction (
Non-blocking
- Authority and ownership are correct for mutations. Claim/release, complete, and progress add use
executionClient(cmd/agentintercom/task_lifecycle.go:60,:100,:138). Server operations check the current execution and enforce claimant ownership (bus/store.go:1423,:1474,:1508;bus/task_progress.go:84). - Output is safely quoted. Task titles and progress text use
%q(cmd/agentintercom/task_lifecycle.go:79,:113,:188). Agent/task identifiers are validated (bus/validation.go:10), progress kinds are restricted (bus/runtime.go:500), and timestamps are generated by the server (bus/store.go:158). - Input limits match the server. Completion notes allow 16384 bytes and progress allows 4000 (
bus/runtime.go:482,:505). File/stdin reads stop at the limit plus one byte (cmd/agentintercom/task_lifecycle.go:224). The server remains responsible for its additional text validation. - The launcher fix is necessary and appropriately scoped.
agent runremoves the owner token and supplies the agent token (cmd/agentintercom/main.go:1001).taskClientenables creation and listing in that environment; task creation records the agent as creator (bus/runtime.go:436). The paginated listing route also accepts either credential (bus/task_page.go:57). - Architecture and dependencies: the PR uses existing Go client operations and standard-library input/flag handling. It adds no dependencies, migrations, compatibility wrappers, scheduler, or server behavior. Its parent and the checkout’s
origin/mainboth point to056e320. - Completion notes are missing from ordinary task listings.
cmd/agentintercom/main.go:760prints descriptions, dependencies, claimants, and recent progress, but notTask.Note. This predates the PR. A completion note is separate from progress history, sotask progress listdoes not reveal it either; task JSON does. - Trailing newlines are preserved. The guide’s
echoexample stores a trailing newline. Both input helpers preserve file contents, and the author disclosed this behavior. Trimming would be a separate product change. - JSON formatting differs, not its validity. Unpaginated task add/list use indented JSON (
cmd/agentintercom/main.go:704,:750); the new commands use compact JSON, like message send. This does not require a fix. - Test output and coverage:
cmd/agentintercom/task_lifecycle_test.go:134,:138, and:142do not capture stdout. The agent-session listing check verifies success but does not inspect its output. Existing owner-list coverage does inspect JSON (cmd/agentintercom/main_test.go:586). - Ordering assumption in a test:
cmd/agentintercom/task_lifecycle_test.go:145assumes the second task is at index 1. The query orders only by millisecondcreated_at(bus/store.go:1558,:156). A synchronous commit is not proof of distinct timestamps; matching by title or ID would be sturdier. No failure was observed. - Comment and naming nits:
cmd/agentintercom/task_lifecycle.go:17points to the wrong file forvalidateText; the function is inbus/validation.go:22, while callers supply the limits inruntime.go. The fix plan corrects the comment. The CLI’s 4000-bytemaxTaskProgressBytesalso shares a name with the server’s unrelated 1 MiB history cap (bus/task_progress.go:12), but the constants are in different packages. - Expiry coverage needs precise wording. The new CLI tests exercise replaced credentials, not elapsed lease expiry (
cmd/agentintercom/task_lifecycle_test.go:112). Existing server tests separately cover expired and replaced executions for all relevant mutations (bus/hardening_test.go:14). The minimum real lease is 30 seconds (bus/validation.go:117). - File layout: task add/list remain in
main.go; the new commands are intask_lifecycle.go. Consolidating task commands later would match the organization of message and channel commands. - Owner transport behavior is pre-existing.
scopeClientlacks the HTTPS and redirect restrictions used byexecutionClient(cmd/agentintercom/main.go:663;cmd/agentintercom/message.go:33). That applies to existing owner commands and is not introduced by this PR. - Formatting verified statically. Both new Go files pass
gofmt -l. CI runs tests, vet, and builds but does not enforce gofmt (.github/workflows/ci.yml:26).
Fix plan
Small mechanical patch; much of the helper change moves or deletes existing code. The implementation plan is unchanged from turn 1.
cmd/agentintercom/message.go
- Replace
messageBody(lines 45–68) with the currenttaskTextimplementation, renamedinputText:// inputText reads text from exactly one of an inline flag or its file flag // ("-" is stdin), so private text can stay out of shell history. name is the // inline flag, for example "--body"; limit is the server's byte limit. func inputText(inline, file string, input io.Reader, name string, limit int, required bool) (string, error) { /* body of taskText */ }
- Line 99:
text, err := inputText(*body, *file, in, "--body", 65536, true)
cmd/agentintercom/channel.go
- Line 52:
text, err = inputText(*body, *file, in, "--body", 65536, true)
cmd/agentintercom/task_lifecycle.go
- Delete
taskText(lines 209–237) and the now-unused"strings"import. - Lines 96 and 134: call
inputTextwith the same arguments. - Line 166:
client, err := taskClient(*address)
- Replace the line 17 comment with:
// Server limits for task text (CompleteTask and AddTaskProgress in bus/runtime.go). - Update the lines 23–27 comment: claim, release, complete, and progress add use only the execution credential; progress list accepts either credential.
- Update the lines 195–198 comment to include
task progress listamong the routes served bytaskClient. Preserve the explanation of owner-token precedence and the launcher environment.
cmd/agentintercom/message_test.go
- Line 62:
_, err := inputText("", "-", strings.NewReader(strings.Repeat("x", 65537)), "--body", 65536, true)
cmd/agentintercom/task_lifecycle_test.go
- Rename the six
taskTextcalls at lines 157, 160, 166, 170, 173, and 175 toinputText. - In
TestTaskCLIClaimProgressComplete, after line 35 add:This is necessary becauset.Setenv("OCTOBER_BUS_SCOPE_TOKEN", "")
startWorkspaceTestsets"untrusted-owner"(cmd/agentintercom/workspace_test.go:25), whichtaskClientwould otherwise prefer. - After line 75 add:
// The workspace owner can read the same history without an agent session. t.Setenv("OCTOBER_BUS_SCOPE_TOKEN", owner.Token) out, err = runTask(t, "", "", "progress", "list", "--id", build.ID, "--json") requireNoError(t, err) requireNoError(t, json.Unmarshal([]byte(out), &entries)) require(t, len(entries) == 2, "owner could not read progress: %#v", entries) t.Setenv("OCTOBER_BUS_SCOPE_TOKEN", "")
docs/cli-messages.md
-
Replace lines 73–78 with:
claim,release,completeandprogress addalways act as the connected session, usingOCTOBER_BUS_AGENT_TOKEN. Only the claiming execution can add progress to, release or complete a task. Another session's claim, an unfinished dependency, or a replaced session returns an error instead of taking the task over.task add,task listandtask progress listuseOCTOBER_BUS_SCOPE_TOKENwhen it is set; insideagent run, which removes that token, they use the session's credential.
Then run in the trusted fix/CI environment
gofmt -l cmd/agentintercom— must print nothing.go vet ./...go build ./cmd/agentintercomgo test -race -count=1 ./cmd/agentintercom ./bus- Exercise the documented workflow in two
agent runshells, then read its progress history from an owner shell.
Message to the developer
Please apply the fix plan above.
n/a
Questions for Harsh
n/a
Verification
- Static audit only: no contributor code, tests, builds, installs, or repository scripts were executed. No checkout files or GitHub state were changed.
- Complete diff reviewed:
git diff 056e3200556b2cfb5dfabf5180755b81b0dcfea9...HEAD; four files, +480/−2. - Independent code verification: both new files in full; affected command dispatch, task creation/listing, address resolution, launcher environment, message/channel input helpers and tests; workspace fixtures and credential-isolation tests; task clients, HTTP handlers, runtime authorization, storage operations, pagination, validation, progress tests, MCP task handlers, conformance checks, TypeScript scope client, and the relevant guides.
- Fix plan checked against callers and fixtures: all helper references are accounted for; accepted message/channel input remains the same; removing the task file’s
stringsimport is correct; the owner-read test clears and restores the fixture credential appropriately. - Read-only checks passed:
git diff --check 056e3200556b2cfb5dfabf5180755b81b0dcfea9...HEADandgofmt -l cmd/agentintercom/task_lifecycle.go cmd/agentintercom/task_lifecycle_test.goproduced no output.git status --shortremained empty. - PR description and discussion read: the plain
gh pr view ... --commentscommand failed on GitHub’s deprecated Projects field. Retrying with explicit JSON fields succeeded. There are no PR comments or submitted reviews. The author’s manual-run and mutation-testing claims were read but not independently executed. - Issue reviewed:
gh issue viewcould not connect, so the public issue and contributor discussion were read through the browser. The requested commands, credential handling, private-text inputs, isolated-daemon coverage, and launcher walkthrough are present. The new negative tests use execution replacement; they do not simulate elapsed lease expiry. - CI verified for the stated head: all 11 reported checks succeeded. Runtime jobs cover Ubuntu, macOS, and Windows; Ubuntu additionally runs the race detector. GitHub reports
MERGEABLE,BLOCKED, andREVIEW_REQUIRED. These results apply to the current head; the planned fixes still need validation. - Ruleset assessment: the feature exposes existing capabilities in a small CLI layer and reuses existing dependencies. The duplicated input helper is the remaining simplicity/reuse concern. No architectural, compatibility, migration, or product-direction decision is needed.
Audit log
- Turn 1 (Claude (fable, xhigh)): Audited from scratch against issue #179 and the ruleset. Confirmed the authority model, output quoting, limits and tests against server code. Raised three small fix items (owner cannot read progress history, duplicate text helper, incomplete doc sentence) and wrote an exact fix plan; decision: fix. Codex should challenge whether finding 2 belongs in Blocking or only Non-blocking, and whether owner access to
progress listis wanted. - Turn 2 (Codex (gpt-6-astra, xhigh)): Independently verified the full diff, all blocking findings, and the proposed fixes against the server contract, existing clients, tests, issue, and PR discussion. Retained the decision and fix plan. Clarified owner permissions, test-coverage limits, and the unsupported estimate of ordering-flake likelihood; confirmed formatting with a read-only check. No material changes.
Automated review by Harsh's agentbox: two AI reviewers audited this PR against the project ruleset and agreed on it.
Per maintainer review: task progress list uses taskClient so the workspace owner can read history without an agent session; taskText and messageBody merge into one inputText helper used by messages, channels and tasks; docs state that progress updates also require holding the task.
Main added its own textInput consolidation (question answer flow); the task commands now reuse it instead of a second helper, with the optional completion note read only when note flags are present.
|
Applied the review fixes on this branch: task progress list now uses taskClient so the workspace owner can read history without an agent session (covered by a new owner-read test block), the duplicated taskText/messageBody helpers are consolidated onto main's textInput (the completion note stays optional by only reading input when note flags are present), and the docs now state that progress updates also require holding the task. Merged current main, verified with gofmt, go vet, and go test -race on cmd/agentintercom and bus (both pass). Ready for re-review. |
Resolved: the audit of c897506 found the requested changes in place.
🤖 Agentbox PR audit: ready to mergeWhat this PR changes
Full audit (Claude (fable, xhigh) × Codex (gpt-6-astra, xhigh), 2 turns, commit c897506)PR audit: #196 — feat(cli): claim, release, complete and report progress on shared tasksHead: c897506 Sign-off
Decisionmerge — all three earlier blockers are resolved, the branch contains the supplied main commit, and all 11 checks pass on this head. No further changes are required before merge. What changes (plain language)
FindingsBlockingNone. The three blocking findings from commit
Non-blocking
Fix plann/a Message to the developern/a Questions for Harshn/a Verification
Audit log
Final checksNot run here: this PR is from an outside contributor, so its code is never executed on this machine. Rely on CI before merging. Automated review by Harsh's agentbox: two AI reviewers audited this PR against the project ruleset and agreed on it. |
harshsaver
left a comment
There was a problem hiding this comment.
Approved after the Claude×Codex audit agreed it is ready (audited head c897506).
harshsaver
left a comment
There was a problem hiding this comment.
Approved after the Claude×Codex audit agreed it is ready (audited head c897506; this head only adds a merge of main).
Closes #179.
Problem
A connected session could add and list shared tasks from a shell, but could not claim, release, report progress or complete them. The Go client already had all of those operations.
There was also a gap inside
agent run. It stripsOCTOBER_BUS_SCOPE_TOKENfrom its child, whiletask addandtask listread only that variable. A shell started byagent runtherefore could not even add a task, although the server accepts the session's own credential for both (taskAuthorityinbus/runtime.go).Change
New subcommands, each with
--id <task-id>,--jsonand--address:executionClient(OCTOBER_BUS_AGENT_TOKEN). They never fall back to workspace or administrator authority, so the server's ownership rules apply unchanged.task addandtask list: they now use a smalltaskClient.OCTOBER_BUS_SCOPE_TOKENkeeps precedence exactly as before; only when it is absent and an agent token is set do they use the session credential. The otherscopeClientcallers (storage, prune, agent list) are untouched.-for stdin to keep them out of shell history. Limits match the server: 16384 bytes for a note (optional) and 4000 for progress (required). The kind is checked before any request.progress listprints other agents' text with%q, asinboxandsessionsdo.--idinstead of a positional ID, becausereceiptFlagArgsonly knows that--addresstakes a value, so a positional ID followed by--note <text>would be parsed wrongly.docs/cli-messages.md, using the twoagent runshells that page already sets up, plus usage lines.No scheduler, ownership semantics or server behavior changes.
Evidence
TestTaskCLIClaimProgressComplete, isolated daemonCONFLICTTestTaskCLIUsesOnlyTheExecutionCredentialOCTOBER_BUS_AGENT_TOKEN; owner token refused; replaced execution cannot complete or add progress, task unchangedtask add/listwork inside an agent session, and the workspace token keeps precedenceTestTaskCLIAddAndListInsideAnAgentSessioncreatedBy: a); with both tokens set it is created by the owner; with neither the error names bothagent runsessions holding only agent tokensdone. The owner token appeared in no outputgofmt,go vet ./...,go test -race -count=1 ./..., demo, SDKtypecheck,build,test:errors, andtest:integrationagainst the built binaryNot covered
message send --body-filedoes.executionClientalready requires HTTPS for remote addresses, and that is unchanged.