Skip to content

fix(client-runtime): recognise offline scratch projects - #26825

Closed
DanielJBurbridge wants to merge 2 commits into
pingdotgg:mainfrom
DanielJBurbridge:fix/offline-scratch-project-identity
Closed

DanielJBurbridge wants to merge 2 commits into
pingdotgg:mainfrom
DanielJBurbridge:fix/offline-scratch-project-identity

Conversation

@DanielJBurbridge

Copy link
Copy Markdown
Contributor

Problem

A disconnected environment’s scratch workspace appears as a numbered “No project” entry in the “New thread in…” selector, alongside the normal “No project” action.

Reproduction: connect a remote environment with a scratch project, let its projects load, then disconnect it and open the project selector. The selector passes no available scratch root while disconnected, so isScratchProject returns false even though the loaded project has isScratch: true.

Change

Recognise the existing scratch marker before falling back to the configured path. Connection availability still controls where new scratch chats can start. No saved projects, chats or folders are changed.

The shared helper also serves web/desktop draft selection and mobile project selection. No wire contracts or provider code change.

Scope and approval

This is a small fix for an obvious classification bug: disconnection should not turn a known scratch workspace into an ordinary project. It uses existing identity data and adds no settings or workflow.

Verification

  • The two unavailable-root assertions fail on the unchanged source and pass with the fix.
  • Focused project identity, entity and grouping tests: 26 passed. Ordinary projects titled “No project” remain ordinary; raw records still match by normalised configured path.
  • Changed-file formatting and lint passed. vp run check:changed was attempted twice, including with reduced CPU threads, but stopped after sustained memory pressure. Its dependent-package type checks and unused-code checks remain incomplete; CI must establish those results.
  • No live client pass or before/after UI captures. Verification covers the shared classification logic; it does not establish cold-start behaviour before any scratch identity has loaded.

Model: GPT-6.1 Sol through the Codex harness in T3 Code.

@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Oct 29, 2026
@macroscopeapp

macroscopeapp Bot commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs Human Approval

Macroscope's review found this PR requires human approval — Scratch projects remain recognizable through their existing marker when the environment’s scratch root is unavailable. This also changes their effective mobile new-task workspace default to local, requiring confirmation of that default behavior.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration
Commits

Reviewing files that changed from the base of the PR and between 9fed7ac and c68ecdb.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between dac8b11 and 9fed7ac.

Files selected for processing: 2
  • packages/client-runtime/src/state/projects.test.ts
  • packages/client-runtime/src/state/projects.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Walkthrough

isScratchProject now recognizes projects marked with isScratch: true, including when the scratch workspace root is unavailable. Tests cover exact configured-path matching and reject nested paths.

Changes: Scratch project recognition

Layer / File(s) Summary
Scratch recognition predicate and validation
packages/client-runtime/src/state/projects.ts, packages/client-runtime/src/state/projects.test.ts
isScratchProject accepts an optional isScratch: true flag and returns true when the flag is set or the non-null scratch root exactly matches the project path. Tests cover unavailable roots, exact matches, and nested paths.

Priority: Normal

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Possibly related issues

  • Issue 26445 concerns special handling for scratch settings. This change updates scratch recognition but does not implement the settings behavior.
  • Issue 23757 concerns scratch identity in the project picker, grouping, and thread views. This change updates the shared recognition predicate, but does not add custom-name or icon rendering.

Suggested reviewers: macroscopeapp, maria-rcks, t3dotgg

Merge Risk: Minimal · previous review 9fed7

Offline scratch recognition improves without an identified merge-blocking issue.

Pre-merge checks: Passed 4
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: recognizing offline scratch projects in client-runtime.
Description check Passed The description covers the problem, reproduction, change, scope rationale, verification results, limitations, and incomplete checks. It is sufficiently complete for this focused bug fix.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@maria-rcks

Copy link
Copy Markdown
Collaborator

Note

Written by gpt-6.1-sol on behalf of Maria

the verification rule applies to #26825 at c68ecdb3ce. the PR targets duplicate No project entries in a disconnected-environment selector, but explicitly supplies no live-client check or before/after UI captures; its shared classification tests do not show the affected selector.

capture the same project selector before and after disconnecting an environment with an already-loaded scratch project, on main and this head, and attach the before/after evidence with the focused test results before reconsideration.

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

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants