fix(acp): expose terminal auth before credential setup - #701
Open
yxlyx wants to merge 2 commits into
Open
Conversation
Fresh registry installs launch without credentials, but startup previously exited before reading initialize, making Terminal Auth unreachable. Add a bounded pre-auth ACP loop that shares the normal initialize response, rejects authenticated methods with ACP AuthRequired, restores early TUI claims before missing-key diagnostics, and reuses per-record parsing memory.\n\nThe credentialed ACP/TUI runtime remains unchanged; the registry listing must be repinned to the first release containing this commit.\n\nCo-Authored-By: Codegraff <blackfloofie@codegraff.com>
The pre-auth integration test sent its exact 65,535-byte boundary record through text-mode subprocess stdin. Windows newline translation could add a carriage return, making the accepted boundary appear oversized and dropping the first initialize response even though ACP behavior was correct. Send explicit UTF-8 bytes so record lengths and delimiters are identical on every platform while retaining the real-binary EOF, oversize, ordering, and response assertions. Co-Authored-By: Codegraff <blackfloofie@codegraff.com>
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.
What changed
graff acpprocess answerinitializebefore provider credential resolution and advertise the existinggraff-loginTerminal Auth method.AuthRequiredfor session/model operations until the client runsgraff loginand restarts it.Why
Problem / failure mode
The ACP Registry installs and starts agents in an isolated HOME, then sends
initializeto discover authentication. Graff advertised Terminal Auth only afterresolveKeys; without a credential it exited first, so fresh registry installs could never discover or launchgraff login. Registry PR agentclientprotocol/registry#558 therefore cannot pass its auth matrix while pinned to v0.0.280 (or v0.0.282).Reason for this approach
The pre-auth loop has no fake provider and does not duplicate the initialize payload. It shares
acp_engine.respondInitialize, serves only protocol/auth discovery, and returns the standard ACP auth-required error for operations needing an Agent. Once login succeeds, a restarted process follows the unchanged credentialed ACP runtime.Constraints and trade-offs
Rejected alternatives
Verification
graff-login(terminal)passedscripts/eval-tier1.sh: greentuiand TTYreplAddresses #613. The issue closes after a release containing this change is pinned and merged in agentclientprotocol/registry#558.