Repository navigation
A profile whose endpoint is the HEY app answers the reads from it - #646
Conversation
hey-cli had no way to reach the HEY desktop app on this computer. #640 wrote one: a JSON-RPC client for the door the Linux app opens at $XDG_RUNTIME_DIR/hey/agent.sock while "Let Agents Use HEY" is on, and a fake door for tests on a temporary Unix socket. This brings internal/localapp over from #640 at fcf918b unchanged, so the profile endpoint built next talks to the app through it. Verified by go test ./internal/localapp/..., the package's own tests. #640's hey local commands do not come with it: the design that replaces them routes the ordinary commands through the app when a profile says so.
An agent on this computer could reach HEY only through HEY's server, with the person's full sign-in. #640 reached the HEY Linux app's door instead, but through a command tree of its own (hey local), apart from the commands an agent already knows. The design that replaces it makes the endpoint a field of a profile, so the ordinary commands answer from the app when the profile says so. A profile may now name "endpoint": "app" (or "server", the default). With HEY_EXPERIMENTAL=app set, such a profile is answered by the HEY app on this computer: hey box view imbox, hey screener list and history, and hey draft list call the door's imbox.list, screener.list and drafts.list, and answer under the server's field names (postings with topic_id and creator, email_address, status, updated_at), the app's own facts beside them. Every envelope names meta.endpoint, and meta.profile as before. On an app profile nothing reads a credential or signs in; every other command that reads a server is refused (exit 1), hey mcp and hey auth with their own words, and so are --account, HEY_ACCOUNT_ID and a repository's account_id; a shut door is exit 6 with the way to open it, never HEY's server instead. A hidden hey app tools|call gives raw access to the door's read tools. Without the gate an app profile is refused as not in this build, and help, .surface and the docs are unchanged. Verified by the new tests in internal/cmd/app_endpoint_test.go and internal/config/profiles_test.go, each against a fake door on a temporary Unix socket and a server that fails the test if reached; each was shown red with its behaviour removed. make check passes, and the build compiles for darwin, windows and linux. Rejected: falling back to the server when the gate is off or the door is shut, which would answer with the person's full sign-in where they chose the app; hey local's own command tree; writes, sends and exit 9, which come in the next pull request; hey profile create --endpoint, left to the setup step that creates the app profile.
There was a problem hiding this comment.
All reported issues were addressed across 19 files
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
The fresh review of the app endpoint found four small gaps. Tab completion was refused on an app profile as a command the app does not offer. hey profile show and list looked for the app profile's credential in the keyring, which it never has and which can prompt on macOS. The Imbox rows carried the server posting's empty note and bubble_up_schedule and a thread read breadcrumb the app profile refuses. And an endpoint written as true or 1 was read as the server. Completion now runs on an app profile; profile show and list name the app in place of a sign-in and read no credential; the Imbox rows carry only what the app has, with no breadcrumb; an endpoint that is not a string is a config error. Verified by TestAppProfileKeepsCompletionAndReadsNoCredential, TestAppImboxRowsCarryNoEmptyServerFields and the non-string case of TestParseProfilesReadsTheEndpoint, each red with its fix removed, and make check. Not changed: --ids-only on the app's screener prints sender ids where the server prints clearance ids, which --json names in meta.id_kind; no command on the app takes either id yet, so it waits for the writes.
There was a problem hiding this comment.
All reported issues were addressed across 6 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
The bot review of the app endpoint found eight gaps. --all was accepted on the app's reads, which answer only what the app has loaded, so a partial list could answer a request for all of it. hey app took --account and ignored it. The app quitting mid-answer was exit 7, not the shut door's exit 6. hey app call on a signed-out app, whose door lists nothing, was a usage error rather than exit 3. A screener count below the senders listed was taken as is; a draft with no Cc read as null; a thread with no sender read as sender 0. An explicit "endpoint": "server" in a nearer config could not override a farther "app", and an app-only entry was not counted as a profile by profile create's first-profile default or by profile delete's repository guard. Now --all is refused on the app like --page; --account is refused on hey app; a connection the app closes is exit 6 with the way to open the door; an empty tool list is exit 3 for hey app call; the screener's count must cover its list; address lists stay lists; creator.id is left out when the app gives none; "server" is kept as written, so it overrides; and config.EntryIsProfile counts an app-only entry wherever entries are counted. Verified by the new and widened tests in app_endpoint_test.go and profiles_test.go, each red with its fix removed, and make check.
…adable store TestAppProfileKeepsCompletionAndReadsNoCredential ran profile show alone, with no credential store at all, so a read of the app profile's credential by profile list, or by show, would have passed unseen. It now writes a credential file nothing can parse and runs both: either read fails the run. Shown red with each command's skip removed.
There was a problem hiding this comment.
All reported issues were addressed across 7 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
There was a problem hiding this comment.
🟡 Changes recommended
Active issues leave early error envelopes without endpoint metadata, prevent explicit server overrides of app profiles, and cause endpoint-only app profiles to be mishandled during creation and deletion.
3 open issues
What changed in this PR
Builds on named profiles to let existing read commands use the HEY desktop app instead of the server, behind HEY_EXPERIMENTAL=app.
Changes:
- Adds profile endpoint selection, unsupported-command refusals, and endpoint metadata.
- Routes Imbox, Screener, and draft listings through the app’s Unix socket, with hidden read-only tool access.
- Adds protocol and command tests using a fake app connection, plus contributor guidance.
[!TIP]
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or rungh pr ready --undo.
Click "Ready for review" or rungh pr readyto reengage.
| File | Description |
|---|---|
internal/localapp/socket.go |
Resolves the app’s socket path. |
internal/localapp/localapptest/door.go |
Provides a fake Unix-socket server for tests. |
internal/localapp/errors.go |
Defines connection and protocol errors. |
internal/localapp/client.go |
Implements MCP initialization, discovery, and calls. |
internal/localapp/client_test.go |
Tests protocol handling, results, and timeouts. |
internal/config/profiles.go |
Parses and validates profile endpoints. |
internal/config/profiles_test.go |
Tests endpoint parsing and selection restrictions. |
internal/cmd/screener_list.go |
Routes pending-sender reads to the app. |
internal/cmd/screener_history.go |
Routes screening-history reads to the app. |
internal/cmd/root.go |
Integrates endpoint routing and response metadata. |
internal/cmd/profile.go |
Displays endpoints and adjusts credential checks. |
internal/cmd/local_config_trust.go |
Exempts direct app commands from repository configuration. |
internal/cmd/endpoint.go |
Centralizes routing, refusals, and app error handling. |
internal/cmd/drafts.go |
Routes draft listings to the app. |
internal/cmd/box.go |
Routes supported box reads to the app. |
internal/cmd/app.go |
Adds hidden tool discovery and read-only calls. |
internal/cmd/app_reads.go |
Maps app listings into CLI output formats. |
internal/cmd/app_endpoint_test.go |
Tests app routes, gating, refusals, and output. |
AGENTS.md |
Documents experimental endpoint conventions for contributors. |
Review effort: Balanced
The delete guard counts a repository entry with "endpoint": "app" and no base_url as a profile since bc9a34e, but no test pinned it: the old base_url-only check passed every test. TestARepositoryAppOnlyEntryHoldsUpADelete deletes a global profile a trusted repository also names as app-only, and is red with the old check.
RegisterProfile's and localEntrySetsProfile's comments still said an entry with no base_url is no profile; since bc9a34e an entry the app answers is one, by config.EntryIsProfile. Comments only.
|
Review summary for cfd5879. Every thread is answered and resolved; the fixes are in 7241ab2, bc9a34e, 4225008, bd7d6e4 and cfd5879, each shown red with its fix removed, and Declined, each with its reasoning in the thread:
Also left as is, in the description's Alternatives: Unrun: a check against a running HEY Linux app, since none had the door open on thelio. Reviewers on cfd5879, a comment-only change: cubic ran on it with no new finding; Greptile last reviewed bd7d6e4 and Copilot 7241ab2, re-requested once. |
…er --all Deleting a profile the HEY app answers looked up its CLI and MCP credentials and revoked any it found, the one place left where the app profile touched the credential store: on macOS that can prompt for the keychain, and it reaches HEY's server for a profile that has no sign-in of its own. A limited app listing (box view imbox, draft list) said "Use --all to see everything", which the app endpoint refuses, and on the Imbox the truncation notice replaced the app's own warning that it has not loaded every thread. Now delete skips the credential lookup and revocation for an app profile, as profile list and show already do; without the experimental gate the profile is treated as a server one and its credentials go as before. App listings say "Run it again without --limit to see them all", and the Imbox appends its not-loaded warning after that line. Verified: TestAppProfileDeleteReadsNoCredential (an unreadable credential store fails any lookup; red before, "could not delete credentials") and TestAppLimitedListingsOfferOnlyWhatTheAppTakes (red before on both routes and on the lost Imbox warning) pass; make check green. Rejected: dropping the leftover credential of a profile hand-edited from server to app on delete. The app profile's contract is that it has no credential; a hand edit that leaves one is cleaned by deleting the profile with the gate off, or by hey auth logout before the edit.
|
Review threads: 2 resolved (2 fixed, in c588eee, with a red-first test each).
CI and cubic are green on c588eee; no threads open. |
On a profile whose endpoint is the HEY app (#646), every write was refused: an agent could read the Imbox, the Screener and the drafts, but not screen a sender, write a draft or ask for one to go. Now, under HEY_EXPERIMENTAL=app, on an app profile: - hey screener approve|deny <sender id or address> runs the door's screener.decide; an address is looked up in the app's own Screener, waiting and decided, so an agent never meets the app's sender ids. - hey compose --draft and hey reply <thread> --draft run draft.write and draft.reply, and answer the draft under the server's field names with hey -P <profile> draft send <id> as its next step. - hey draft send <id> runs message.send, which the app holds in its window until the person presses Send: it answers meta.status pending, says "Waiting in HEY ... nothing has been sent" and exits 9, a code nothing else exits with; help exit-codes lists 9 under the gate only. - compose and reply without --draft, bulk-reply send and forward are refused before anything happens, pointing at --draft and then hey draft send; flags the door has no field for are refused likewise. - The door's write refusals (not_an_address, not_saved, not_a_sender, disabled, an id it does not hold) and its two answers that may have done something (saved_not_listed, session_ended) say what to do. On every profile, hey screener approve|deny also take a sender's email address, looked up among the clearances waiting, then those decided. Verified: each behaviour red against #646's head first (18 tests; the 3 flag-refusal guards already held there, #646 refusing every write); a test with HEY_TOKEN set and a server that fails if reached runs every verb above, done and refused, and goes red when draft send's app branch is removed. make check green, .surface unchanged, darwin, windows and linux build. Rejected: turning a send into a draft quietly on the app, which would make send mean two things; several senders per screening on the app, which the door decides one at a time, so a partial failure would need its own report.
#648) * An app profile writes drafts and asks HEY to send, which waits for you On a profile whose endpoint is the HEY app (#646), every write was refused: an agent could read the Imbox, the Screener and the drafts, but not screen a sender, write a draft or ask for one to go. Now, under HEY_EXPERIMENTAL=app, on an app profile: - hey screener approve|deny <sender id or address> runs the door's screener.decide; an address is looked up in the app's own Screener, waiting and decided, so an agent never meets the app's sender ids. - hey compose --draft and hey reply <thread> --draft run draft.write and draft.reply, and answer the draft under the server's field names with hey -P <profile> draft send <id> as its next step. - hey draft send <id> runs message.send, which the app holds in its window until the person presses Send: it answers meta.status pending, says "Waiting in HEY ... nothing has been sent" and exits 9, a code nothing else exits with; help exit-codes lists 9 under the gate only. - compose and reply without --draft, bulk-reply send and forward are refused before anything happens, pointing at --draft and then hey draft send; flags the door has no field for are refused likewise. - The door's write refusals (not_an_address, not_saved, not_a_sender, disabled, an id it does not hold) and its two answers that may have done something (saved_not_listed, session_ended) say what to do. On every profile, hey screener approve|deny also take a sender's email address, looked up among the clearances waiting, then those decided. Verified: each behaviour red against #646's head first (18 tests; the 3 flag-refusal guards already held there, #646 refusing every write); a test with HEY_TOKEN set and a server that fails if reached runs every verb above, done and refused, and goes red when draft send's app branch is removed. make check green, .surface unchanged, darwin, windows and linux build. Rejected: turning a send into a draft quietly on the app, which would make send mean two things; several senders per screening on the app, which the door decides one at a time, so a partial failure would need its own report. * An id the app does not hold is not found, and a cut-off send says nothing went A fresh review of the app's writes found an app profile answering a sender or draft id the app doesn't hold with exit 1, where the same sender by address, and the server for an id it doesn't hold, answer 2; a send cut off by the app's session end worded as "may have been done", which reads as sent; a disabled send with no arg hinted " takes one of"; and a Screener address lookup stopped at its 100-page cap answering not found, which it never searched. Now an id refusal naming the ids the app holds is exit 2; the cut-off send says it may be waiting in HEY and nothing has been sent without you; the hint names the draft; and a capped lookup is exit 7, pointing at the clearance ID. Verified: each red first against 60d0455 (four subtests and one test), then make check green. * Only a disabled send names the draft, and only a cap stops an address lookup The second review found the previous commit naming the draft as the argument of every message.send refusal without one, so an older app's not_offered got the wrong hint and an unloaded list's unavailable became a usage error (1) instead of the app's (7); and the address lookup's cap check reading the cursor, which an empty last page still carries, so a short Screener could be called past the cap. Now the draft is named in the disabled case alone, and the cap check reads collectPages' Truncated. Verified: three new cases red against f7cf0cf, then make check green. * An app answer that did otherwise sends you to HEY, and refusals keep the profile Bot review (cubic, Copilot) found: an app answer saying it decided or saved something other than what was asked hinted at upgrading hey, and a non-pending answer to a send said only that it wasn't waiting, where both may have changed something; the refusal of a verb that sends now suggested hey draft send without -P, which on a server default profile runs an app draft id against the server; and an address missing from a Screener the app lists only part of answered not found, unsearched. Now those answers say the app may have done something and send you to HEY before running it again; the refusal names -P <profile>; and an address missing from a partial list is exit 7, pointing at the sender ID. The empty-page lookup test's server answers only the PATCH it expects. Verified: five tests red against 6724516 first, then make check green. * The partial-Screener hint names the profile, and both answers word the check alike A review of 9154df1 found the hint for an address missing from a partial Screener naming a bare hey screener list, which on a server default profile lists clearance ids, not the app's senders; and the two "may have done something" answers wording their check two ways. Now the hint names -P <profile> and both say "before running it again". Verified: make check green. * Every hint on an app profile names its commands on that profile Copilot's review of 9154df1 found the saved_not_listed hint naming a bare hey draft list, which on a server default profile lists the server's drafts: the person concludes the save failed and writes the draft again. Eight more hints on the app's paths named a command the same way, some of them listing server ids that the next command would then act on at the server. Now every hint on the app's paths goes through appCommandLine, so each names -P <profile>; TestAppHintsNameTheProfile holds it for seven of them. Verified: red against ddc0175 (the saved_not_listed case and six of seven hints), then make check green. * Tests start with no endpoint and no config, whatever order they run in CI's Race Detection, which runs the suite shuffled, failed on TestAFailedAnswerNamesTheProfile (seed 1794515981961670522): an app profile run before it left answeringEndpoint set, so withProfileMeta added meta it expected not to. A second seed, 1794520381712021194, failed TestAccountOverrideNotice the same way through a leftover cfg. Now the root-flag reset every CLI test uses restores the endpoint and the config after each run, and both tests set what they assume. Verified: both seeds red on thelio before, green after, with four more shuffled runs green. * The Imbox comes from the app however its profile is chosen A dev build was reported answering hey box view imbox with meta.endpoint server under an app profile. Run hermetically, the built binary answers from the app (exit 6 with no door, meta.endpoint app) with the gate, and refuses without it; it answers server only when the config holding the profile isn't the one hey reads (XDG_CONFIG_HOME pointing elsewhere), where there is no app profile to choose. This test holds the routing for the default profile, -P and HEY_PROFILE over a server default, with and without the gate, with a token at hand and a server that fails the test if reached. It passes on a0f020f's code: a guard, not a fix.
* origin/main: nix: add a CPE for hey-cli (#605) An app profile writes drafts and asks HEY to send, which waits for you (#648) A profile whose endpoint is the HEY app answers the reads from it (#646) deps: bump golang.org/x/sys from 0.49.0 to 0.50.0 deps: bump github.com/spf13/pflag from 1.0.10 to 1.1.0 (#635) deps: bump github.com/itchyny/gojq from 0.12.19 to 0.12.20 (#637) deps: bump golang.org/x/sync from 0.24.0 to 0.25.0 (#638) deps: bump github.com/sigstore/sigstore-go from 1.3.0 to 1.4.0 (#611) deps: bump github.com/yuin/goldmark from 1.8.6 to 1.8.7 (#612) ci: bump the github-actions group across 1 directory with 7 updates deps: bump go.opentelemetry.io/otel/trace from 1.44.0 to 1.47.0 in the go_modules group across 1 directory (#651) Check smoke cleanup across switched-off calendars Fail smoke tests when fixture cleanup fails # Conflicts: # internal/cmd/profile.go # internal/config/profiles.go # internal/config/profiles_test.go


Context
$XDG_RUNTIME_DIR/hey/agent.sock, open while Settings › General › "Let Agents Use HEY" is on), but through ahey localcommand tree of its own.heycommands answer from the app when the profile says so, behindHEY_EXPERIMENTAL=app, the default stays the server, no auto-switching.sent/waitingand exit 9 next; setup and the skill after.Change
"endpoint": "app"(or"server", the default); an app profile needs nobase_url. Any other value is a config error, never read as the server.HEY_EXPERIMENTAL=app, an app profile is answered by the app's door:hey box view imbox(imbox.list),hey screener listandhey screener history(screener.list),hey draft list(drafts.list).topic_id,creator,seen;email_address;statusapproved/denied;updated_at,scheduled_delivery_at); the app's own facts ride along (made_as,sendable,kind, addresses);meta.id_kind: "sender"on the screener, whose ids are senders, not clearances.meta.endpoint(apporserver) in an experimental build, besidemeta.profile.--account,HEY_ACCOUNT_ID, a profile's own and a repository'saccount_idare refused (exit 1); every other command that reads a server is refused as "not offered by the HEY app on this computer" (exit 1),hey mcpandhey auth/login/logoutin their own words; another box,--pagelikewise; bareheyprints help, no wizard.hey app tools|call, registered only under the gate, runs the door's read tools; a tool of any other effect is refused before it is called.profile listandprofile showname the endpoint under the gate.internal/localappcomes from hey local: ask the HEY app on this computer to act for you #640 at fcf918b unchanged..surfaceand the docs are unchanged.Verification
internal/cmd/app_endpoint_test.go(21 tests) and two ininternal/config/profiles_test.go, each against a fake door on a temporary Unix socket and a server that fails the test if reached.hey app's registration,profile list's endpoint, each of the four routes, the refusals of other verbs,--accountandHEY_ACCOUNT_ID, the shut door's exit 6, signed out's exit 3, the requiredhas_more,hey app call's read-only check,meta.endpoint, a mistyped or non-string endpoint, completion and the credential-freeprofile showon an app profile, and the Imbox rows without the server's empty fields..surfaceunchanged (make check-surface),hey commandslists noapp,profile listrows and server envelopes carry no endpoint,hey appis an unknown command.make checkgreen;GOOS=darwin,windows,linuxbuild.Alternatives
creatorvs. a door-onlysenderfield:creator {id, name}chosen so a script reads both endpoints alike; the id is the app's.hey profile create --endpoint app: left to the setup step that creates the app profile; the config is written by hand until then.hey auth status,hey doctorandhey config showlines for an app profile: refused or unchanged here, follow-ups with setup.box view sent|spam: the door serves no such list yet, so they are refused like any other box.--ids-onlyon the app's screener prints sender ids, the server's clearance ids;--jsonnames it inmeta.id_kind. Left as is: no command on the app takes either id until the writes land.XDG_RUNTIME_DIRunset and noHEY_LOCAL_SOCKETis exit 1 (usage: run from the desktop session), not exit 6: there is no door to call shut.