Repository navigation
bl apps background: status and off for owner-authorized background tool calls - #54
Conversation
…ol calls Add `bl apps background status APP_ID` and `bl apps background off APP_ID`, which read and revoke an app owner's background tool call access through Kgoose's hosted-apps background-access endpoints using the stored CLI session. Approval stays browser-only: `status` prints the approval link for the owner to open and the CLI never approves. Kgoose error codes map to CLI-owned messages and exit codes (background_disabled, not_owner, other_publishers, unsupported runtimes, and so on) without echoing server text. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Automated reviewAPPROVE WITH CAUTION — Revocation can be falsely confirmed during a concurrent approval, and disabled environments receive misleading retry guidance. From F1 — [WARNING] Reject all still-granted states after revocationLocation: Lines 2132 to 2144 in 9bdef90 The command rejects only F2 — [WARNING] Handle unavailable management endpoints in disabled environmentsLocation: Lines 2249 to 2255 in 9bdef90 When background access is disabled in the service, the management endpoint is not registered, so the commands receive a route-level 404 rather than the Reviewed at commit |
…g endpoint as disabled Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
🤖 Addressed both findings in 8da697e:
Tests cover both, and fmt, clippy and the full suite pass. |
|
🤖 AI-assisted PR review SummaryAdds Verdict✅ Recommend approval — the new commands match the management API contract, handle revocation races and failures conservatively, and preserve the browser-only approval boundary.
FindingsNo material findings. 🤖 Review by StampMaster9000 · not a substitute for human review · reviewed at commit |
Why
Kgoose now lets an app owner authorize background tool calls for a Compose process app (enabled only in bb-block). The owner can check and revoke that access in the browser, but there was no CLI path, so an owner or their agent could not see whether an app was on, ready, or waiting for approval, and could not turn it off from a terminal.
What
bl apps background status APP_IDshows the state, whether the owner is the sole publisher, whether the app is ready or restarting, and the approved and pending read-only tools. When approval is needed it printsApprove in your browser: <link>as the next step.bl apps background off APP_IDrevokes background access and confirms the new state. It only reduces access, so it asks for no confirmation, likebl apps publishers removeandbl apps community revoke.bl apps deleteneeds--confirm-app-idbecause deletion is destructive.GET/DELETE /v1/hosted-apps/{app_id}/background-accessthrough Kgoose with the storedbl auth loginsession (sameKGOOSE_BASE_URL,KGOOSE_SERVICE_PATH, org, profile, andBL_HOMEresolution asbl apps community list). No--base-urlis needed.--jsonprints the response normalized to snake_case withokandapp_id, like otherbl appsJSON.errorCodevalues map to CLI-owned messages, anext_action, and exit codes:background_disabledsays background tool calls aren't available in this environment (exit 1),not_ownerexits 4, a 401 exits 3, and server orunavailablefailures exit 5. Server message text is never echoed.Approval stays browser-only by design. Kgoose accepts the grant only from the owner's browser session through a same-origin form, so an agent holding the CLI session cannot turn background access on. The CLI only prints the link and has no approve command.
Testing
just fmt-check,just lint(clippy with-D warnings), andjust test(full workspace) pass.statuswith and without an approval link,off(DELETE, plus a failure if the app still reports active),background_disabled, an unauthenticated 401, no stored session, the error-code mapping, and unsafe approval links.bl apps background statusagainst a real bb-block production app; it reported the app as on and ready with its approved tools.offwas not run against a real app.🤖 Generated with Claude Code