revert(host): the desktop's account inbox reads the held route again, while Neon Realtime fails to start in production

Merged
CH
6d ago
+611-1590

Why

#3217 (squash 2302746fd) moved the desktop's account inbox (the Inbox tab, the Dock badge, and the notices) onto Neon Realtime. Production's Realtime engine keeps failing to start (logical-slot bootstrap timed out, then admission cooldowns), and main has no fallback, so a desktop built from main shows an empty Inbox tab. The service still serves the old held route, GET /api/inbox?after=… (HOSTED_SERVICE_PATH.INBOX, inbox-page.ts), for released desktops. This PR puts the desktop back on that route.

A plain git revert 2302746fd conflicts, because main has moved on a lot since (oRPC, threads, and more). So this restores only the client side, in main's current shapes.

What changed

  • Host: main's notices (agent-notices.ts) read the account inbox in a loop again. Each read is held with a cursor through codingAgents.accountInbox, and a failure or defect waits out the watch interval. The composer's method is back, along with the operator's codingAgentAccountInbox.
    • Removed: account-inbox-follow.ts, the follow and unfollow methods, the accountInbox.changed event, the composer's reset, and @neon/realtime in the host.
  • Features: HostedCodingAgentClient.accountInbox(after) is back. It goes through the oRPC hosted client's inbox.account procedure, held, and always sends archived=include. accountInboxLive is removed. codingAgentAccountInboxParamsSchema and codingAgentAccountInboxAnswerViewSchema are back, with their JSON-schema goldens.
  • Web: the PageReturns seam is removed, because only the live follow used it. That also removes its layer in web-host.ts and stale-release.ts's backOnline, which nothing else used. pageShownAgain stays, because the stale-release reload still uses it.

Main's newer inbox behaviour stays, because the held read carries it on the service: unread state, chat waiting, archived tasks (archived=include), #3992's threads, and failed runs aging out of the 7-day window (the held cursor digests the runs inside the window).

Kept on purpose

  • The service's live route: /api/live/inbox, contract/live.ts, live-procedures.ts, realtime.ts, and live-wire.ts's schemas. The desktop no longer uses them, but they're harmless, and the unmerged stack builds on them.
  • #3993's live-statement.ts and its test.
  • Removed only because knip flagged them as unused: live-wire.ts's nextFailedRunExpiry and the AccountInboxLiveAnswer type, which only the follower used. The schemas the service uses stay.

Checks run

  • Typecheck: gateway, features, host, panel, web, desktop.
  • Tests: the full host and features suites, the panel's coding-agent tests, and web stale-release and web-notices.
  • scripts/repository-checks.sh, pnpm lint, pnpm knip, pnpm discarded-effect.

pnpm check:affected was run piece by piece, because it runs out of memory in the sandbox.

Made with Luke


Devin Review