Comprehensive Checkpoint Testing Coverage

I’ll review this like a PR: first identify the branch delta against the local base, then read the touched code and tests for regressions or missing coverage. I’ll also run the repo’s entire agent-help once as requested by the repo guidance.
The branch is soph/cli-api-passthrough and the worktree appears clean. I’m checking the local base branch and the exact file delta now so the review is against the intended comparison point, not uncommitted noise.
The branch adds a new hidden-ish entire api passthrough plus tests and a small API client helper. I’m reading the full diff with enough context now, then I’ll validate behavior against nearby command and auth patterns.
The implementation is mostly self-contained, but it reaches into existing auth, mirror filtering, and API-client plumbing. I’m checking those call sites next because passthrough commands are easy to get subtly wrong around target selection and auth precedence.
I found the new command reuses auth status target resolution for core calls, which is good because it preserves the ENTIRE_TOKEN precedence documented in this repo. I’m drilling into the URL and body handling now; that’s where passthrough tools often create script-visible surprises.
One high-risk edge is emerging: the passthrough accepts a user-supplied “path”, and the shared URL resolver may treat absolute or scheme-relative inputs as a different host. I’m confirming the exact call chain and line numbers before deciding whether this is a finding.
Beyond the host issue, I’m checking whether the new helper methods preserve the semantics users would expect from -H and --input. The tests cover the happy path, but not the more security-sensitive URL cases.
The URL resolver is only used through api.Client, so the new entire api command is the first place arbitrary user input reaches it directly. I’m still scanning for a second independent issue, but the host validation gap is already strong enough to call out.
I’m going to run the focused CLI package tests to catch any compile or unit failures in the changed package. This won’t run the real agent E2E suite.
The focused test command is still running. While it runs, I’m checking the diff history to see whether the latest commit intentionally narrowed the command surface or just refactored it.
The latest commit was a simplification pass with “No behaviour change”, so the host-validation issue came from the original passthrough design rather than the cleanup. I’m waiting on the focused tests and checking command registration/docs consistency as the last pass.
go test ./cmd/entire/cli passed. I’m also running the API subpackage tests because the branch changes cmd/entire/cli/api/client.go directly.
Both focused test packages pass. I’m doing a final review pass over line references and any residual risks before summarizing findings.
The worktree stayed clean after tests. I have the review findings now; I’m just pulling one final line reference for the command registration.
Findings
- High: cmd/entire/cli/api_cmd.go sends authenticated requests using the user-supplied
<path>without rejecting absolute or scheme-relative URLs.api.Clientresolves that path through ResolveURLFromBase, andurl.ResolveReferencewill lethttps://evil.example/...or//evil.example/...replace the intended Entire host. Since the bearer transport then addsAuthorizationat client.go,entire api https://...can leak the Entire token to another host, including plainhttp://despite the base URL TLS check. Validate that<path>is origin-relative before callingRequest, or verify the resolved host still matches the selected backend.
Verification
env GOCACHE=/tmp/go-build go test ./cmd/entire/clienv GOCACHE=/tmp/go-build go test ./cmd/entire/cli/api
I’ll re-review the current branch state against origin/main, assuming the branch may have changed since the last pass. I’ll check the delta first, then focus on whether the previous host-validation issue was fixed cleanly and whether any new regressions were introduced.
The branch now has an extra commit specifically addressing the token-leak fix. I’m reading that patch first, then I’ll re-scan the full added command for edge cases around URL parsing, auth target selection, and response/body handling.
The fix now rejects absolute and scheme-relative paths before the request, which addresses the previous token-leak vector. I’m continuing the re-review for non-security behavior regressions in the new passthrough surface, especially places where flags imply one thing but the shared client forces another.
One user-facing problem is surfacing: the core target path returns a SilentError for missing auth without printing the login hint first. I’m confirming how SilentError is handled so I can distinguish an actual blank failure from a normal Cobra error.
There’s another credential-boundary edge worth calling out: the path validation stops direct cross-host inputs, but the shared http.Client can still follow redirects, and the bearer transport runs again on the redirected request. I’m checking the focused tests now; after that I’ll summarize only the issues that look actionable.
The focused CLI and API package tests pass. I’m doing a final line-reference pass for the two remaining findings and checking the worktree stayed untouched.
Findings
-
High: api/client.go still uses the default redirect-following
http.Client, and bearerTransport.RoundTrip re-addsAuthorizationon every redirected request. So the new path validation blocksentire api https://evil/..., butentire api /some/redirectcan still leak the bearer if the selected backend returns a cross-hostLocation. Add aCheckRedirectguard that rejects origin changes, or make the transport attach auth only whenreq.URLmatches the client’s base origin. -
Medium: api_cmd.go returns
NewSilentErrorfor missing core auth without printing anything first.main.gosuppressesSilentError, soentire api /api/v1/clusterswhile logged out exits non-zero with no hint. Other commands printNot logged in. Run 'entire login' to authenticate.before returning a silent error; this should do the same or return a normal error.
The previous direct absolute/scheme-relative path leak is fixed by validateAPIPath.
Verification run:
env GOCACHE=/tmp/go-build go test ./cmd/entire/cli
env GOCACHE=/tmp/go-build go test ./cmd/entire/cli/api