Skip to content

fix(app): discover server projects and sessions across browsers - #53752

Open
BunsDev wants to merge 1 commit into
anomalyco:v2from
BunsDev:web-server-discovery
Open

BunsDev wants to merge 1 commit into
anomalyco:v2from
BunsDev:web-server-discovery

Conversation

@BunsDev

@BunsDev BunsDev commented Oct 7, 2026 •

Copy link
Copy Markdown

Issue for this PR

Closes #13626

Related: #24035, #51475

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

A fresh browser on a shared server showed no projects, and sessions created
or deleted in another browser never reached the Home list.

Project list: the sidebar came only from this browser's stored project list
(createServerController in runtime/server/runtime.tsx), so a fresh browser
listed nothing even though /api/project had the inventory. The list is now
the browser's opened projects followed by the server's other projects; closing
one stays a local preference. A project registered by another client's first
session arrives as session.created only (the server publishes no
project.updated for it), so that event reloads the inventory once.

Session list: session.deleted from other clients now removes the row, and the
index is refetched when the event stream reconnects, since events sent while
it was down are lost.

No browser-storage migration: discovered projects are derived from the server,
not written to the stored list.

How did you verify your code works?

  • New two-context e2e cases in packages/app/e2e/regression/home.spec.ts
    (fail on v2 before the fix): fresh browser discovery, create/rename/delete
    in one browser reaching another, reload / reconnect / cleared storage,
    server and project scoping, failed fetch keeping the sidebar.
  • bun run typecheck and lint:changed clean on changed lines.
  • Manual check with two Chromium contexts against a real opencode serve
    (isolated data dir): unpatched build lists sessions but no project rows;
    patched build lists projects, including one registered live by the other
    client.

Note: pushed with the local pre-push hook skipped; its bun run typecheck
fails on untouched origin/v2 in this environment too (@opencode/console-app
/ @opencode/stats-app vite.config.ts overload errors). packages/app
typecheck passes.

Screenshots / recordings

Before/after screenshots follow in a comment.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

A fresh browser on a shared server listed no projects because the sidebar came
only from this browser's stored project list, and sessions created or deleted
in another browser never reached Home.

List the browser's opened projects followed by the server's other projects;
closing one stays a local preference. The server publishes only
session.created when another client's first session registers a new project,
so that event reloads the inventory once. Remove rows on session.deleted from
other clients and refetch the session index when the event stream reconnects.

Fixes anomalyco#13626

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. needs:issue labels Oct 7, 2026
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Oct 7, 2026
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

@BunsDev

BunsDev commented Oct 7, 2026

Copy link
Copy Markdown
Author

@Hona @Brendonovich (app CODEOWNERS) — could one of you approve the workflow runs on this fork PR when you have a moment? test/check/nix-eval are waiting on first-contributor approval.

Two notes for triage:

  • needs:issue is a false positive: the description has Closes #13626, but the standards check only reads closingIssuesReferences, which GitHub leaves empty for PRs targeting v2.
  • This overlaps the project-list half of fix(app): show server-known projects in project lists #51475 and adds the session-list side (session.deleted from other clients, refetch on reconnect, and inventory reload on session.created for a project the client hasn't seen, since the server sends no project.updated for it). Happy to rebase onto fix(app): show server-known projects in project lists #51475 if you'd rather land that first.

@BunsDev

BunsDev commented Oct 7, 2026

Copy link
Copy Markdown
Author

Before/after on a real opencode serve (fresh data dir), browser B opened with empty storage after browser A created sessions in two projects.

Before (v2 @ 34cf183): sessions arrive from /api/session, but the sidebar has no project rows — only "Add project".

before: fresh browser lists sessions but no projects

After (this PR): the fresh browser lists projA and projB from the server inventory (projB was registered live by browser A while B was open), alongside the same sessions.

after: fresh browser lists projects and sessions

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant