Repository navigation
bl apps background on: walk owners through turning on background tool calls - #57
Conversation
… calls Add `bl apps background on APP_ID` (--no-browser, --timeout): it opens the approval link, polls until the app's sandbox has restarted and background tool calls are on and ready, and exits non-zero with a reason when approval is blocked, access is paused or revoked, or the wait times out. Progress goes to stderr; --json prints one final status object on stdout. Status now surfaces Kgoose's optional blockedReason (as blocked_reason), so owner_consent_required and no_read_capabilities are visible. Fix owner_consent_required being reported as "declared tools changed", and say "process or fetch-js apps" instead of process-only. Test builds never open a real browser. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Automated reviewAPPROVE WITH CAUTION — Three nonblocking issues at dbb8fc2: paused grants cannot reach reapproval, requests can exceed --timeout, and interrupted response bodies bypass retries. From F1 — [WARNING] Allow initially paused grants to reach reapprovalLocation: src/bl/apps.rs:2928–2941
F2 — [WARNING] Bound each status request by the remaining timeoutLocation: src/bl/apps.rs:2896–2897 The loop checks its deadline only after fetching, while each fetch retains a fixed 30-second HTTP timeout. Consequently, F3 — [WARNING] Retry transport failures while reading response bodiesLocation: src/bl/apps.rs:2802–2806 If the server sends headers and then the connection drops or the body times out, Reviewed at commit |
|
🤖 AI-assisted PR review SummaryAdds Verdict
Findings
F1 — [WARNING] Allow initially paused grants to reach reapprovalLocation: src/bl/apps.rs lines 2928–2941
F2 — [WARNING] Enforce the timeout across each status requestLocation: src/bl/apps.rs lines 2896–2897 The deadline is checked only after F3 — [WARNING] Retry response-body transport failuresLocation: src/bl/apps.rs lines 2802–2806 If headers arrive and the connection then drops or times out while 🤖 Review by StampMaster9000 · not a substitute for human review · reviewed at commit |
Summary
Turning on Kgoose background tool calls for a hosted app meant copying
approval_urlfrombl apps background statusinto a browser. When approval was refused (for exampleowner_consent_required, because the owner hadn't approved the app's own tool access yet), the CLI didn't say why or what to do.bl apps background on <APP_ID>(--no-browser,--timeout, default 600s):blocked_reasonwith a link (owner consent), prints the reason and next step, opens the app, and waits until it clears.paused_other_publishers/revoked, or timeout. Retries transient network/5xx errors.--jsonprints one final object on stdout.--no-browser.bl apps background statusshowsblocked_reason({code, message, next_step, url}, null when absent).owner_consent_requiredgets its own explanation instead of "declared tools changed".Dependency
blocked_reasoncomes from a Kgoose change in squareup/cash-server: https://github.com/squareup/cash-server/pull/159449. This PR works without it (the field is just null), but the consent step only appears once Kgoose ships, so merge after it.Testing
just cipasses (rustfmt, clippy-D warnings, tests; 15 new tests inapps.rs).🤖 Generated with Claude Code