Skip to content

Reviews: show only my PRs, by the login of my GitHub credential - #1719

Merged
akwirick merged 3 commits into
mainfrom
reviews-mine-filter
Nov 4, 2026
Merged

akwirick merged 3 commits into
mainfrom
reviews-mine-filter

Conversation

@akwirick

Copy link
Copy Markdown
Contributor

Summary

The Reviews tab now has an All / Mine switch. "Mine" shows only the pull requests whose author is the reader's GitHub login, as their connected GitHub credential names it.

Before this change, engrams did not know the login: a pasted personal token was saved with no account data. This PR has two commits:

  1. Record the account name of a pasted personal token. A connector can declare userCredential.token.identity, a bounded "who am I" request to one of its hosts. The orchestrator sends it with the token in the new PutCredentialRequest.identity field. The coordinator runs it before the seal and keeps the display and workspace names. GitHub declares GET /user → login.
    • The account id stays empty, even when the map names one (the connector parse also refuses accountId). A stored id would block a later OAuth connect to a different account.
    • If the provider refuses the token (or cannot be reached), the token is not saved. The route returns 400: "Could not confirm this token with GitHub. Check the token and try again." The credentials form now shows the server's message instead of /me/… → 400.
    • The probe parse moves out of parseOauth into shared helpers, so both probes use one validation.
  2. All / Mine switch on the ledger and the rail. "Mine" uses the existing server-side author filter, and hides the Author filter while it is on. The rail uses the same per-browser choice and shows "My reviewed PRs". If GitHub is not connected, or the token names no login yet, "Mine" says how to fix it and links to Settings → Credentials. It does not show an empty list.

Upgrade note

A GitHub token saved before this change names no login. Users must save their GitHub token again in Settings → Credentials once before "Mine" works. Settings then shows the login next to the GitHub entry.

Notes

  • Reviews come only from GitHub today, so a match on the author login alone is correct. If reviews come from another forge later, the filter must also match the provider.
  • buf.build was not reachable when I generated the bindings. I made the TypeScript bindings with local protoc-gen-es v2.2.5 (the pinned version). Only the new field changed in oauth_pb.ts.

Test plan

  • cargo nextest run -p engram-coordinator --test oauth_user_credentials: the new tests show that the lookup names the account with an empty account id, and that a refused token is not saved
  • just check: fmt, clippy and hakari pass. 3195 of 3196 tests pass when engram-harness-codex is left out. The tests that fail (engram-harness-codex dynamic-tool tests, engram-uffd-handler stalled_alt_source_…) fail the same way on the base commit in my environment.
  • Orchestrator: bun run typecheck, and bun test for connectors, me-oauth and slack-integration. In the full suite, github-events-route failed once on a 9 s timeout and passes alone.
  • Web: pnpm format:check, pnpm lint, pnpm build, and vitest for pages/reviews, components/settings and router
  • Manual: in a dev stack, save a GitHub token and confirm that Settings shows the login and that Reviews → Mine filters to that author

🤖 Generated with Claude Code

akwirick and others added 2 commits October 29, 2026 22:59
A personal token saved in Settings -> Credentials had no account data. So
engrams did not know whose token it was (for GitHub: the login).

A connector can now declare `userCredential.token.identity`: one bounded
"who am I" request to one of its hosts. The orchestrator sends it with the
token in `PutCredentialRequest.identity`. The coordinator runs it with the
token before the seal, and keeps the display and workspace names. The
account id stays empty, so a later OAuth connect to a different account
still replaces the token. If the provider refuses the token, the token is
not saved, and the route returns 400 with a plain message. GitHub declares
`GET /user` -> `login`.

The parse of the probe moves out of `parseOauth` into shared helpers, so
the OAuth metadata probe and the token identity probe use one validation.

The credentials form now shows the server's message instead of the status
line.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
"Mine" shows only pull requests whose author is the reader's GitHub login,
as their connected GitHub credential names it. It uses the existing server
author filter, and hides the Author filter while it is on. The rail uses
the same per-browser choice, so the switcher and the ledger list the same
pull requests.

If GitHub is not connected, or the token was saved before engrams recorded
the login, "Mine" says how to fix it instead of showing an empty list.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

The latest Buf updates on your PR. Results from workflow CI / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed⏩ skipped⏩ skipped✅ passedNov 4, 2026, 3:26 PM

The identity probe of a pasted token reported every failure as
"probe_failed", and the route answered each one with 400 "Check the
token". A GitHub outage or a 5xx then told the user that the token was
bad.

The probe now reports HTTP 401 and 403 as "probe_rejected". The route
answers a refusal with 400 and tells the user to check the token. It
answers any other probe failure with 503 and tells the user to try again.
The token is not saved in either case.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@nikhilunni
nikhilunni added this pull request to stack #1731 November 4, 2026 15:27
@nikhilunni
nikhilunni enabled stacked auto-merge November 4, 2026 15:28
stacked auto-merge was automatically disabled November 4, 2026 20:37

Auto-merge was disabled for another pull request in the stack

@nikhilunni
nikhilunni added this pull request to the merge queue Nov 4, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 4, 2026
@akwirick
akwirick added this pull request to the merge queue Nov 4, 2026
Merged via the queue into main with commit 672d072 Nov 4, 2026
89 of 93 checks passed
@akwirick
akwirick deleted the reviews-mine-filter branch November 4, 2026 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants