Show GitHub login in agent me#11
Merged
Merged
Conversation
`/v1/me` now returns a `gh_user` object, so `agent me` can print the human login instead of just the numeric account id: user: hbrooks (24214708) falling back to the bare id when the server has no cached gh_user (and omitting the user line entirely for API-key/sandbox principals, as before). Extracts the rendering into an exported `renderMe` and covers the three cases with a test. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.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
Follow-up to the backend change that added
gh_usertoGET /v1/me(ellipsis-dev/ellipsis#5331, merged).agent mecould only print the numeric GitHub account id:Now it shows the human login when the server resolved one:
Changes
src/lib/types.ts: add aGhUserinterface andgh_user: GhUser | nulltoWhoAmI(loosely typed pastlogin, matching the rest of the hand-rolled mirror types).src/commands/me.ts: prefergh_user.login (user_id)over the bare id; fall back to the id whengh_useris null; still omit the user line for API-key/sandbox principals. Rendering is extracted into an exportedrenderMe.test/me.test.ts: covers the three cases (login resolved, id fallback, no user line for API keys).Verification
Local run of every CI step:
bun run typecheck,bun run test(89 passed, 3 new),bun run build, andbun build --compile+--version. All green.🤖 Generated with Claude Code