Skip to content

Fix the clear push-notification deep-link defects found in #894 #897

Closed

Description

@proagentstore

The clear, unambiguous defects from the #894 research (#894). These do not need an owner decision; implement them. The page-gap questions (engine sign-in has no screen, no per-run page, no per-board-card route) stay in #894 for Serge.

Fix

  1. Three producers send no url and fall back to /console/. Give each a specific link: routes/coding-reauth.ts:184 ('Coding engine signed in'), lib/engine-reauth-expiry.ts:159 ('sign-in expires ~5 min'), and lib/coding-session-sweeper.ts multi-instance sleep (sleepNotification() ~:289, url undefined when several instances). Use the session link when one session is known; otherwise the instance's coding tab (/instances/:id/coding); never bare /console/. As an interim, fall back to the row's instance_id (migration 0147) rather than nothing.
  2. console.proagentstore.online lands on home. Producers emit /console/... but that host's router has no /console basename. Make the link resolution work on both hosts (the Notifications page already strips a leading /console via notificationRoute; the service-worker / push path must do the equivalent so a click resolves on console.proagentstore.online). Verify on both hosts.
  3. Sign-in drops the query string. A signed-out deploy tap loses ?builds=. Preserve the full target (path + query) across the sign-in redirect and continue to it after login.
  4. OS notification tag is the type ("coding"). A newer coding notification replaces an older one still in the tray along with its link. Use a tag unique per subject (e.g. type + instance/session/run id) so distinct notifications coexist.
  5. Missing url silently allowed. Make a missing url a hard failure in dev/tests and a logged warning in prod, so a new producer cannot ship without a deep link. Extend the existing console-links test.
  6. In-app Notifications rows with no url do nothing. Fall back to /instances/:instance_id using the stored instance_id.

Also verify (flagged, do before closing)

  • ?builds= cold open may be overridden by CodingTab auto-opening the last repo's active session (CodingTab.tsx:197,208 vs :372,410-424) — confirm the deploy link actually lands on Builds.

Tests for each; commit direct to main (no PR); closes this issue when done. Leave #894 open for the page-gap decisions.

Activity

  1. serge-ivo commented on Oct 5, 2026

    @serge-ivo
    Contributor

    Fixed in 3b3b790 (Closes #897). CI, Deploy API Worker and Deploy Host Worker are all green.

    What was fixed

    1. Producers that sent no url now link a specific page instead of /console/:
      • "🔑 Coding engine signed in" (routes/coding-reauth.ts) and "⏳ sign-in expires in ~5 min" (lib/engine-reauth-expiry.ts) open the coding session of the run that is parked on, or was stopped by, the sign-in (signInSessionId). When no run is involved they open the instance's Coding tab.
      • An idle-sleep batch covering several instances (sleepNotification) opens the instance list. A single instance still opens its Coding tab.
    2. console.proagentstore.online: store/sw.js now strips the /console prefix on that host, the same rule notificationRoute applies in-app. It recognises console tabs by origin and path; before, it effectively matched the hostname by accident. Clicks resolve on both hosts, whether the tab is closed or already open.
    3. Sign-in continuation: handleOAuthCallback now removes only ?session= (withoutSessionParam). A signed-out tap on a deploy notification keeps ?builds=<repo> and any hash.
    4. Tray tag: the tag is now type:<deep link> (notificationTag), so notifications about different subjects coexist, while repeats about the same subject still collapse (e.g. one entry per repo for deploys).
    5. Missing url: notifyUser's url is now required by its type, so a new producer without a link fails typecheck in CI. If one is still missing at runtime, it is logged to error_log (source push, warn) and the notification opens the instance or the feed, never the home screen.
    6. In-app rows with no url open their instance_id (migration 0147), through the pure notificationClick helper.

    The flagged check: confirmed, and fixed. On a ?builds= cold open, CodingTab restored the last repo's session (or, for a single-repo agent, the solo session). That navigated to /coding/:sessionId, dropped ?builds=, and replaced the Builds view. pickAutoOpenSession and shouldAutoOpenSoloSession now skip auto-opening on a builds deep link.

    Tests:

    • push-deep-link.test.ts: fallback plus log, per-subject tag, signInSessionId.
    • sw.test.ts: runs the real sw.js on both hosts (cold, open tab, a non-console tab, no link, push tag). 4 of its 8 tests fail on the old sw.js.
    • notification-click.test.ts: the in-app click order and sign-in continuation.
    • Producer link assertions in coding-reauth.test.ts, engine-reauth-expiry.test.ts and coding-session-sweeper.test.ts.
    • Builds auto-open cases in session-open.test.ts and repo-open.test.ts.
    • Full suite: 13,441 passed.

    Left open on #894 (owner decisions, as the issue said): engine sign-in has no screen of its own, so the session is the closest target; chat-driver runs and board cards have no per-item page; approvals still live on the Board card; and native app push. Secure-input requests don't send a push today (the link goes back to the MCP caller), so there was no notification to fix there. Not yet verified on a real device: iOS and Android installed-PWA behaviour.

  2. added 2 commits that reference this issue on Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions