Skip to content

fix: lots of desktop stability, better e2e error logging#18300

Merged
thdxr merged 19 commits intoanomalyco:devfrom
Hona:fix/red-ci
Mar 20, 2026
Merged

fix: lots of desktop stability, better e2e error logging#18300
thdxr merged 19 commits intoanomalyco:devfrom
Hona:fix/red-ci

Conversation

@Hona
Copy link
Copy Markdown
Member

@Hona Hona commented Mar 19, 2026

The pain

  • Workspace routing mixed URL slug identity with canonical directory identity.
  • Sidebar selection, session restore, and workspace comparisons were using mismatched path forms.
  • Several e2e specs were asserting on stale slug/localStorage assumptions instead of settled route/session state.
  • Those e2e flows also exposed real backend/frontend races during concurrent prompt and workspace activity.

The solution

  • Use the slug for the URL and the canonical directory for layout state, comparisons, and remembered session routes.
  • Base project/workspace active state on routed project identity and normalized workspace keys.
  • Make e2e project/workspace fixtures unique per worker and wait on semantic route/session state.
  • Restore real UI coverage in the workspace new-session flow instead of replacing it with backend setup.
  • Ignore benign async session-summary/title updates after session deletion.
  • Keep streaming message parts mounted while guarding against transient undefined reads.

Fixes

  • Fix workspace/session routing regressions after app: fix workspace flicker when switching directories #18207.
  • Fix sidebar project/workspace selection mismatches.
  • Deflake workspace-new-session, projects-switch, and session-model-persistence by removing invalid test assumptions and fixing the real races/crashes they exposed.

@Hona Hona requested a review from adamdotdevin as a code owner March 19, 2026 22:40
Copilot AI review requested due to automatic review settings March 19, 2026 22:40
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Normalizes workspace identity handling in the app layout by separating the URL slug (params.dir) from the canonical workspace directory used for state, comparisons, and session-route remembering—aimed at fixing inconsistent workspace/session routing and associated E2E failures.

Changes:

  • Introduces a route memo that derives { slug, dir }, using the slug for URL identity and a canonicalized directory for internal layout logic.
  • Updates currentDir and session-prefetch preservation logic to compare directories via workspaceKey(...) rather than mixing slug/path forms.
  • Adjusts active route tracking to use route().slug for session URL identity and currentDir() (canonical directory) for internal state and route remembering.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


createEffect(() => {
params.dir
route()
Copy link

Copilot AI Mar 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The prefetch-reset effect now depends on route(), which also reacts to globalSync.child(...).path.directory. When the directory store finishes bootstrapping and updates path.directory, this effect will rerun even if the URL slug didn’t change, clearing prefetchQueues/inflight and bumping prefetchToken mid-session. If the intent is to reset only on URL/workspace changes, consider depending on route().slug (or params.dir) instead of the full route() object (or split slug vs resolved-dir dependencies).

Suggested change
route()
const { slug } = route()

Copilot uses AI. Check for mistakes.
@Hona Hona changed the title fix(app): normalize workspace route identity in layout fix(app): normalize workspace route identity and workspace e2e Mar 19, 2026
@Hona Hona changed the title fix(app): normalize workspace route identity and workspace e2e fix(app): align workspace routing and deflake workspace e2e Mar 20, 2026
@rekram1-node
Copy link
Copy Markdown
Collaborator

/review

@github-actions
Copy link
Copy Markdown
Contributor

lgtm

@Hona Hona changed the title fix(app): align workspace routing and deflake workspace e2e fix: fix workspace routing bugs and deflake e2e Mar 20, 2026
@Hona Hona changed the title fix: fix workspace routing bugs and deflake e2e fix: lots of desktop stability, better e2e error logging Mar 20, 2026
@thdxr thdxr merged commit d460614 into anomalyco:dev Mar 20, 2026
8 of 9 checks passed
@Hona Hona mentioned this pull request Mar 20, 2026
demostanis pushed a commit to demostanis/opencode that referenced this pull request Mar 20, 2026
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.

4 participants