Repository navigation
Fix CLI exit and error reporting, runtime discovery ownership, task errors and hosted OAuth hardening - #210
harshsaver wants to merge 31 commits into
Conversation
A shadowed error variable meant a rejected upload printed null and exited successfully. Return the upload error instead.
When XDG_RUNTIME_DIR is unset the runtime directory lives under the shared temporary directory. Clients now read bus.json only when it and its directory belong to the current user and are not group or world writable, and the daemon refuses a runtime directory owned by another user instead of failing with a permission error.
Dynamic client registration is unauthenticated and clients were never removed, so filling the 50,000-client cap blocked new connections permanently. At capacity, evict the oldest clients that are over a day old and hold no pending request or token.
Advertise and send the RFC 9207 iss parameter so MCP clients that talk to several authorization servers can detect mix-up attacks.
Admins can issue member invitations but could revoke any pending invitation, including admin invitations from the owner. Apply the same role rule to revocation as to issuance.
Concurrent requests with the same session token share one Auth lookup. It ran on the first caller's context, so a cancelled request failed every other request waiting on it.
The README installs agentintercom-cli@0.2.0, but several documented commands landed later. List them in the changelog and note in each guide that they need a source build until the next release.
The state-machine specification requires NOT_FOUND for an unknown task, as claim already returns. Complete and release reported CONFLICT for any task they could not change.
Resolving a pending escalation sends the answer as a message, which was refused with BACKPRESSURE once the scope held 10,000 active messages, leaving the question unanswerable. Give answers bounded headroom of their own and accept archives within that limit.
Committing an expired reservation released its messages without first materializing message expiry, so an already-expired message was reported as released before it was reported as expired.
A failing child made agent run exit 1, and an interrupted run exited 0. Exit with the child's status, and report a failure after an interrupt.
Receipts are readable by the sender or recipient agent only, as the HTTP specification and the runtime already state.
…cher On Windows the launcher forwarded Ctrl+C with child.kill(), which terminates the native process before the daemon can shut down; the console already delivers the interrupt to it. Report signal exits as 128 + signal, and stop re-raising SIGPIPE (ignored by Node) and SIGUSR1 (which starts Node's inspector).
PullInbox reserves and then commits. A failed or cancelled commit left the messages reserved and invisible until the 30-second reservation expired. Release the reservation on a best-effort basis before returning the error; a reservation that did commit is unaffected.
6e611cb to
89f6255
Compare
Replace the internal service codename and references to private repositories, pull requests and commits in the managed-connection, remote-integration, release-notes and verification records with neutral descriptions of October Desktop and the hosted service. Drop hosting provider details and unrelated planning items from the pilot report and point its links at the current repository name.
RFC 6749 section 4.1.2 asks the authorization server to revoke tokens issued from an authorization code that is presented again. A replayed code now retires its connection the same way a replayed refresh token does. The replay must carry the code's PKCE verifier, so a party that only observed the code cannot use it to revoke the legitimate client's connection.
Requests that fail before the runtime responds now throw BusNetworkError, BusTimeoutError or BusAbortError, subclasses of a new BusTransportError that records the failure kind and the underlying cause. They still extend BusError with code INTERNAL, so existing handlers keep working.
The unauthenticated OAuth registration, authorization and device pairing endpoints only had global rate limits, so one client could exhaust them for everyone. hosted serve --client-ip-header names the forwarding header the TLS proxy sets; each client then gets its own bucket, checked before the global one so excess requests do not drain shared capacity. The client is the rightmost untrusted entry in the header, proxies are trusted from loopback unless listed with --trusted-proxy, and IPv6 clients are grouped by /64. The per-client table is bounded. Limits stay global-only unless the header is configured.
🤖 Agentbox PR audit: approved, but the branch got new commits after the auditWhat this PR changes
Full audit (Claude (claude-opus-5-5, xhigh) × Codex (gpt-6.1-sol, xhigh), 2 turns, commit 6e611cb)PR audit: #210 — Fix CLI exit and error reporting, runtime discovery ownership, task errors and hosted OAuth hardeningHead: 6e611cb Sign-off
Decisionmerge — no blocking findings; the changes address concrete failures, and all 11 CI checks pass at 6e611cb. Merge remains conditional on the final checks passing. Should this exist?
What changes (plain language)
FindingsBlocking
Non-blocking
Fix plann/a Message to the developern/a Questions for Harshn/a Verification
Audit log
Final checks (run once, after both agents agreed)go mod download: PASS Automated review by Harsh's agentbox: two AI reviewers audited this PR against the project ruleset and agreed on it. |
…romise uploadAttachment threw synchronously for data over 16 MiB, so callers that attached a rejection handler to the promise never saw the error.
Deleting an attachment took the process-wide maintenance lock exclusively and waited for every running read, export and backup. Go queues new readers behind a waiting writer, so a long export plus a deletion in one workspace blocked file access in all of them, and exports also held the global file mutex while reading every file. Deletion now commits its tombstone without that lock and unlinks the file only if no reader is running; otherwise garbage collection removes it later, as it already does after a backup. Reads and exports no longer hold the file mutex once the directory is open.
🤖 Agentbox PR audit: needs Harsh's inputQuestions
What this PR changes
Answer in a comment on this PR; the next daily audit reads it. Full audit (Claude (claude-opus-5-5, xhigh) × Codex (gpt-6.1-sol, xhigh), 1 turns, commit 7eaa418)PR audit: #210 — Fix CLI exit and error reporting, runtime discovery ownership, task errors and hosted OAuth hardeningHead: 7eaa418 Sign-off
Decisionneeds-input — after the earlier merge-approved audit (at 6e611cb), the branch gained an opt-in per-client rate-limit feature for the hosted service. Product rules say to ask Harsh when a PR adds limits. The feature has no evidence of need, no issue, no mention in the PR description, and our own deployment does not turn it on. Should this exist?
What changes (plain language)
FindingsBlocking
Non-blocking
Fix plann/a Message to the developern/a Questions for Harsh
Verification
Audit log
Automated review by Harsh's agentbox: an AI reviewer questioned whether this PR should exist, so it went to Harsh before any detailed review. A second reviewer has not checked it; a full review follows once Harsh answers. |
Replacing a connection reset revoked_at, so a member could undo an owner's or admin's revocation and get the connection's sessions and inbox back. Revocations of another member's connection now record the revoker in a new hosted_devices.revoked_by column, and replacement refuses such connections. Owners can still replace connections they revoked themselves.
Maintenance selects workspaces and then prunes each one. A workspace deleted between those steps made pruning fail with no rows, so the run reported an error even though nothing was left to prune.
🤖 Agentbox PR audit: needs Harsh's inputQuestions
What this PR changes
Answer in a comment on this PR; the next daily audit reads it. Full audit (Claude (claude-opus-5-5, xhigh) × Codex (gpt-6.1-sol, xhigh), 1 turns, commit af89cad)PR audit: #210 — Fix CLI exit and error reporting, runtime discovery ownership, task errors and hosted OAuth hardeningHead: af89cad Sign-off
Decisionneeds-input — the opt-in per-client rate limiter (49a4f19) is still in the PR, and the 19:46 question asking whether it should exist is unanswered (no reply on the PR). Product rules say not to approve a PR that adds limits without Harsh's say. Three more unrelated commits have landed since, and the PR description still covers none of the ten commits added after the first audit. Should this exist?
What changes (plain language)
FindingsBlocking
Non-blocking
Fix plann/a Message to the developern/a Questions for Harsh
Verification
Audit log
Automated review by Harsh's agentbox: an AI reviewer questioned whether this PR should exist, so it went to Harsh before any detailed review. A second reviewer has not checked it; a full review follows once Harsh answers. |
Fixes and documentation corrections found while reviewing the repository for a public release. Each commit is self-contained and has its own tests where behaviour changes.
Bugs
attachment uploadprintednulland exited 0 when the server rejected the upload (shadowed error).agent runexited 1 for any failing child and 0 after an interrupt; it now passes the child's exit status through.CONFLICT; the state-machine specification requiresNOT_FOUND.pullInbox/PullInboxcommit left messages reserved for 30 seconds. The clients now release the reservation.Security hardening
XDG_RUNTIME_DIR, the runtime directory falls back to the shared temporary directory. Clients now ignore abus.jsonthat another local user owns or could have replaced, and the daemon refuses a runtime directory owned by another user. Before this change, a planted discovery file could receive scope tokens.issparameter, and the server metadata advertises it.Documentation
0.2.0candidate. The guides note that thetask claim/progress,questionanddownloadAttachmentfeatures need a source build until the next release.Verification
go test -race ./...,go vet ./..., and the Postgres hosted tests.0.2.0quickstart in a clean container with Claude Code and Codex installed.