feat(cli): report hosted agent status - #821
Merged
Merged
Conversation
|
I hit an error while handling your request (Model unavailable on AI Gateway free tier: Free tier users do not have access to this model. Upgrade to paid credits at https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai%3Fmodal%3Dtop-up for unrestricted…). Please try again, rephrase, or reach out if it keeps failing. Error id: c8662db1-46ad-4469-9fd1-7dbf655335aa |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
pascal agent status [--json]so an agent can verify its hosted credential and observe claim state after the human handoff.The command calls the fixed production status endpoint with redirects disabled, a 15-second timeout, and a 32 KiB response cap. It returns only the versioned agent ID, mode, claim state, and organization-scope flag; server-controlled descriptive fields and response bodies are not printed.
Validation:
bun run check-typesinpackages/clibun test srcinpackages/cli(64 tests, 187 assertions)git diff --checkNote
Low Risk
Read-only hosted credential check that reuses the existing claim client’s secret-handling patterns; no local editor or project access changes.
Overview
Adds
pascal agent status [--json]so hosted agents can confirmPASCAL_API_KEYis valid and see claim state without starting a claim flow.getAgentStatusinagent-account.tscallsGET /api/auth/agent/statuswith the same guardrails as claim: bearer auth,redirect: 'error', 15s timeout, 32 KiB response cap, and strict parsing that returns onlyschemaVersion,agentId,mode,claimed, andorganizationScoped(extra server fields and secrets are dropped). Shared JSON reading is refactored so claim and status reuse one bounded reader with operation-specific errors.The CLI prints human-readable lines (with a nudge to run
pascal agent claimwhen autonomous and unclaimed) or JSON via--json. README and help text document the command; unit and integration tests cover success, HTTP errors, malformed/oversized bodies, and terminal-safe output.Reviewed by Cursor Bugbot for commit 0080060. Bugbot is set up for automated code reviews on this repo. Configure here.