Skip to content
Source
Sign inSign up
pingdotgg/t3code

Add preferred Pi model settings and pickers #2211

Closedjlmcmich(GitHub profile, opens in a new tab)wants to merge 47 commits intomain fromrefs/pull/2211/headopened View on GitHub

Summary

  • add Pi settings for favorite models and a configurable default model
  • use those preferences in the splash screen and chat composer model pickers
  • fix provider switching so Pi falls back to Pi defaults instead of reusing another provider model slug

Validation

  • bun fmt
  • bun typecheck
  • bun run test src/modelSelection.test.ts src/composerDraftStore.model.test.ts src/composerDraftStore.test.ts (from apps/web)

Notes

  • bun run test --filter=@workbench/web still hits an unrelated existing failure in apps/web/src/components/chat/MessagesTimeline.test.tsx

Note

Medium Risk Moderate risk because it changes CLI/package identifiers, filesystem base directories, environment variable names, and Electron protocol/userData handling, which can affect upgrades and runtime startup across platforms.

Overview Rebrands the product from T3 Code to Workbench across docs, marketing, release workflow metadata, package names, and user-facing strings.

Renames the server CLI/package from t3 to workbench, updates build/release filters, and adds backward-compatible config/env handling (e.g., WORKBENCH_* with fallback to legacy T3CODE_*, default base dir migration from ~/.t3 to ~/.workbench).

Updates the desktop app identity (bundle id, protocol scheme workbench://, Linux desktop entry/userData dir naming) while keeping legacy support (t3:// scheme registration and legacy userData dir detection), and improves dev DX by starting a apps/server bundle watcher alongside Electron dev. Also adds a new /.well-known/workbench/environment endpoint alongside the legacy /.well-known/t3/environment, and extends git text-generation provider typing to include "pi".

Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit f0912ed07d559d84f147f316a4ee6bacc6bad1f4. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).

Note

Add 'pi' provider settings, model pickers, and Console rail to Workbench

  • Introduces a new pi provider throughout the stack: contracts (PiSettings, PiModelOptions, PiModelSelection), server adapter (PiAdapter.ts) that spawns the pi CLI in JSON mode to stream runtime events, and a PiProvider.ts that checks install/auth/version status and lists models.
  • Adds settings UI for pi in SettingsPanels.tsx: a PiLoginPanel that fetches backends from /api/provider/pi/backends, triggers terminal login via /api/provider/pi/login, and a preferred-models picker with favorite/default model controls.
  • Replaces PlanSidebar in ChatView.tsx with a resizable ConsoleRail that renders Files, Recent Changes, and Tasks panes, supports per-pane collapse/visibility, workspace file preview/edit/diff, and selection-to-chat insertion.
  • Renames the monorepo from @t3tools/* to @workbench/* across all packages, renames the server CLI binary from t3 to workbench, updates localStorage keys (with legacy fallback reads), and updates all branding strings, icons, and well-known paths (e.g. /.well-known/workbench/environment).
  • Risk: localStorage key migration is one-shot and transparent, but NetService context identifier changed (@workbench/shared/Net/NetService), which could break any external code resolving the service by string key.
📊 Macroscope summarized f0912ed. 73 files reviewed, 7 issues evaluated, 0 issues filtered, 5 comments posted

🗂️ Filtered Issues

    1. Important

      Review skipped

      Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

      ⚙️ Run configuration

      Configuration used: Repository UI

      Review profile: CHILL

      Plan: Pro

      Run ID: c31ce3e0-d5ae-4074-8155-af0cd921ca7c

      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
      ✨ Finishing Touches
      🧪 Generate unit tests (beta)
      • Create PR with unit tests

      Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

      ❤️ Share
      Comment `@coderabbitai help` to get the list of available commands and usage tips.
    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    3. Cursor Bugbot has reviewed your changes and found 1 potential issue.

      Fix All in Cursor ❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the [Cursor dashboard](https://www.cursor.com/dashboard/bugbot). Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit f0912ed07d559d84f147f316a4ee6bacc6bad1f4. Configure [here](https://www.cursor.com/dashboard/bugbot).
      @@ -59,3 +59,14 @@
      5959 });
      6060
      6161 export const serverEnvironmentRouteLayer = HttpRouter.add(
      62+ "GET",
      63+ "/.well-known/workbench/environment",
      64+ Effect.gen(function* () {
      65+ const descriptor = yield* Effect.service(ServerEnvironment).pipe(
      66+ Effect.flatMap((serverEnvironment) => serverEnvironment.getDescriptor),
      67+ );
      68+ return HttpServerResponse.jsonUnsafe(descriptor, { status: 200 });
      69+ }),
      70+);
      71+
      72+export const legacyServerEnvironmentRouteLayer = HttpRouter.add(

      Legacy environment route layer likely never mounted

      Medium Severity

      The original serverEnvironmentRouteLayer export was split into two: a new serverEnvironmentRouteLayer (serving /.well-known/workbench/environment) and a new legacyServerEnvironmentRouteLayer (serving /.well-known/t3/environment). If the server composition code only references serverEnvironmentRouteLayer, the legacy route layer is exported but never mounted, silently breaking backward compatibility for any existing clients hitting the old /.well-known/t3/environment endpoint.

      Additional Locations (1)
      Fix in Cursor Fix in Web
      Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit f0912ed07d559d84f147f316a4ee6bacc6bad1f4. Configure [here](https://www.cursor.com/dashboard/bugbot).
    4. Closing this because the branch should be reviewed in jlmcmich/workbench rather than upstream.

    5. @@ -0,0 +94,21 @@
      94+
      95+ let current = root;
      96+ for (let index = 0; index < segments.length - 1; index += 1) {
      97+ const segment = segments[index]!;
      98+ const path = segments.slice(0, index + 1).join("/");
      99+ let next = current.directories.get(segment);
      100+ if (!next) {
      101+ next = {
      102+ kind: "directory",
      103+ name: segment,
      104+ path,
      105+ changed: false,
      106+ directories: new Map(),
      107+ files: [],
      108+ };
      109+ current.directories.set(segment, next);
      110+ }
      111+ current = next;
      112+ }
      113+
      114+ const changed = changedPaths.has(entry.path);
      macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      🟡 Medium lib/workspaceFileTree.ts:114

      At line 114, changedPaths.has(entry.path) uses the original entry.path which may have a trailing slash (e.g., "workbench/"), but changedPaths contains artifact paths without trailing slashes. Entries for submodules or nested git repos will never be marked as changed even when their normalized path exists in changedPaths. The check should use normalizedPath instead.

      -    const changed = changedPaths.has(entry.path);
      +    const changed = changedPaths.has(normalizedPath);
      🤖 Copy this AI Prompt to have your agent fix this:
      In file apps/web/src/lib/workspaceFileTree.ts around line 114:
      
      At line 114, `changedPaths.has(entry.path)` uses the original `entry.path` which may have a trailing slash (e.g., `"workbench/"`), but `changedPaths` contains artifact paths without trailing slashes. Entries for submodules or nested git repos will never be marked as changed even when their normalized path exists in `changedPaths`. The check should use `normalizedPath` instead.
      
      Evidence trail:
      apps/web/src/lib/workspaceFileTree.ts lines 82-87 (comment explaining trailing slash case), lines 85-86 (hasTrailingSlash and normalizedPath logic), line 114 (changedPaths.has(entry.path) using entry.path instead of normalizedPath), apps/web/src/components/console/ConsoleRail.tsx lines 233-236 (changedPaths populated from artifacts without trailing slashes), apps/web/src/lib/workspaceFileTree.test.ts lines 32-45 (test confirming trailing-slash entries exist but no test combining trailing-slash entries with changedPaths lookup)
      @@ -57,2 +58,21 @@
      5758 const COMPOSER_PERSIST_DEBOUNCE_MS = 300;
      5859
      60+const composerBaseStorage = (() => {
      61+ if (typeof localStorage === "undefined") return createMemoryStorage();
      62+ // back-compat read for migration; remove in next major.
      63+ return {
      64+ getItem: (name: string) => {
      65+ const fresh = localStorage.getItem(name);
      66+ if (fresh !== null) return fresh;
      67+ if (name === COMPOSER_DRAFT_STORAGE_KEY) {
      68+ return localStorage.getItem(LEGACY_COMPOSER_DRAFT_STORAGE_KEY);
      69+ }
      70+ return fresh;
      71+ },
      72+ setItem: (name: string, value: string) => {
      73+ localStorage.setItem(name, value);
      74+ },
      75+ removeItem: (name: string) => {
      76+ localStorage.removeItem(name);
      77+ },
      78+ };
      macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      🟢 Low src/composerDraftStore.ts:75

      removeItem only deletes the new key, so stale legacy data remains in localStorage. When a user clears drafts and then reopens the composer, getItem falls back to the legacy key and resurrects the old draft. Consider also removing LEGACY_COMPOSER_DRAFT_STORAGE_KEY in removeItem to prevent zombie data.

      Suggested change
      75- removeItem: (name: string) => {
      76- localStorage.removeItem(name);
      77- },
      78- };
      75+ removeItem: (name: string) => {
      76+ localStorage.removeItem(name);
      77++ if (name === COMPOSER_DRAFT_STORAGE_KEY) {
      78++ localStorage.removeItem(LEGACY_COMPOSER_DRAFT_STORAGE_KEY);
      79++ }
      80+ },
      🤖 Copy this AI Prompt to have your agent fix this:
      In file apps/web/src/composerDraftStore.ts around lines 75-78:
      
      `removeItem` only deletes the new key, so stale legacy data remains in `localStorage`. When a user clears drafts and then reopens the composer, `getItem` falls back to the legacy key and resurrects the old draft. Consider also removing `LEGACY_COMPOSER_DRAFT_STORAGE_KEY` in `removeItem` to prevent zombie data.
      
      Evidence trail:
      apps/web/src/composerDraftStore.ts lines 60-78 (REVIEWED_COMMIT): `composerBaseStorage` IIFE defines:
      - `getItem` (lines 65-71): fallback to `LEGACY_COMPOSER_DRAFT_STORAGE_KEY` when new key returns null
      - `removeItem` (lines 75-77): only removes the passed `name`, not the legacy key
      
      Constants at lines 44-46:
      - `COMPOSER_DRAFT_STORAGE_KEY = "workbench:composer-drafts:v1"`
      - `LEGACY_COMPOSER_DRAFT_STORAGE_KEY = "t3code:composer-drafts:v1"`
      @@ -0,0 +26,21 @@
      26+ readonly args: ReadonlyArray<string>;
      27+}): Promise<PiCommandResult> {
      28+ const child = spawn(input.binaryPath, [...input.args], {
      29+ stdio: ["ignore", "pipe", "pipe"],
      30+ shell: process.platform === "win32",
      31+ env: process.env,
      32+ });
      33+
      34+ child.stdout?.setEncoding("utf8");
      35+ child.stderr?.setEncoding("utf8");
      36+
      37+ const stdoutChunks: Array<string> = [];
      38+ const stderrChunks: Array<string> = [];
      39+
      40+ child.stdout?.on("data", (chunk: string) => stdoutChunks.push(chunk));
      41+ child.stderr?.on("data", (chunk: string) => stderrChunks.push(chunk));
      42+
      43+ const code = await new Promise<number>((resolve, reject) => {
      44+ child.once("error", reject);
      45+ child.once("exit", (exitCode) => resolve(exitCode ?? 0));
      46+ });
      macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      🟡 Medium provider/piRuntime.ts:43

      Using child.once("exit", ...) returns the exit code before stdout and stderr streams finish draining, so the final chunks of output are lost in the returned PiCommandResult. The close event fires only after all stdio streams are fully closed. Consider changing "exit" to "close" to capture complete output.

      +  const code = await new Promise<number>((resolve, reject) => {
      +    child.once("error", reject);
      +    child.once("close", (exitCode) => resolve(exitCode ?? 0));
      +  });
      🤖 Copy this AI Prompt to have your agent fix this:
      In file apps/server/src/provider/piRuntime.ts around lines 43-46:
      
      Using `child.once("exit", ...)` returns the exit code before `stdout` and `stderr` streams finish draining, so the final chunks of output are lost in the returned `PiCommandResult`. The `close` event fires only after all stdio streams are fully closed. Consider changing `"exit"` to `"close"` to capture complete output.
      
      Evidence trail:
      apps/server/src/provider/piRuntime.ts lines 43-53 at REVIEWED_COMMIT - shows `child.once("exit", ...)` pattern followed by immediately returning the collected chunks. Node.js child_process documentation confirms that `exit` fires when the process terminates while `close` fires after all stdio streams are fully closed: https://nodejs.org/api/child_process.html#event-close
      @@ -0,0 +418,21 @@
      418+ await vi.waitFor(() => {
      419+ expect(document.querySelector('button[title="Quick edit this file inline"]')).not.toBeNull();
      420+ });
      421+ });
      422+
      423+ it("clicking Quick edit reveals the textarea + Save and Cancel buttons", async () => {
      424+ mockReadFileResponse = {
      425+ contents: "# Original\n\nBefore the edit.",
      426+ relativePath: "some/file.md",
      427+ truncated: false,
      428+ };
      429+ await using _ = await mountRail({
      430+ workspaceRoot: "/Users/jlm/proj",
      431+ focusedPath: "/Users/jlm/proj/some/file.md",
      432+ });
      433+ await page.getByTitle("Quick edit this file inline").click();
      434+ await vi.waitFor(() => {
      435+ expect(page.getByLabelText("Edit file contents")).toBeDefined();
      436+ expect(document.body.textContent ?? "").toContain("Save");
      437+ expect(document.body.textContent ?? "").toContain("Cancel");
      438+ });
      macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      🟢 Low console/ConsoleRail.browser.tsx:435

      Line 435 uses expect(page.getByLabelText("Edit file contents")).toBeDefined(), which always passes because page.getByLabelText() returns a Locator object that is always truthy regardless of whether the element exists in the DOM. This test cannot fail even when the textarea is missing. Consider using await expect(...).toBeVisible() or a direct DOM query like line 517 to verify actual element presence.

      -    await vi.waitFor(() => {
      -      expect(page.getByLabelText("Edit file contents")).toBeDefined();
      -      expect(document.body.textContent ?? "").toContain("Save");
      -      expect(document.body.textContent ?? "").toContain("Cancel");
      -    });
      +    await vi.waitFor(() => {
      +      expect(document.querySelector('textarea[aria-label="Edit file contents"]')).not.toBeNull();
      +      expect(document.body.textContent ?? "").toContain("Save");
      +      expect(document.body.textContent ?? "").toContain("Cancel");
      +    });
      🤖 Copy this AI Prompt to have your agent fix this:
      In file apps/web/src/components/console/ConsoleRail.browser.tsx around lines 435-438:
      
      Line 435 uses `expect(page.getByLabelText("Edit file contents")).toBeDefined()`, which always passes because `page.getByLabelText()` returns a Locator object that is always truthy regardless of whether the element exists in the DOM. This test cannot fail even when the textarea is missing. Consider using `await expect(...).toBeVisible()` or a direct DOM query like line 517 to verify actual element presence.
      
      Evidence trail:
      apps/web/src/components/console/ConsoleRail.browser.tsx lines 430-438 (showing the defective assertion at line 435: `expect(page.getByLabelText("Edit file contents")).toBeDefined();`), apps/web/src/components/console/ConsoleRail.browser.tsx lines 510-525 (showing correct approach at line 517: `expect(document.querySelector('textarea[aria-label="Edit file contents"]')).not.toBeNull();`), Playwright documentation confirms getByLabelText() returns a Locator object which is always truthy.
      @@ -4,0 +154,21 @@
      154+ }));
      155+ }
      156+
      157+ return [...providers].toSorted(
      158+ (left, right) => PROVIDER_MENU_ORDER[left.provider] - PROVIDER_MENU_ORDER[right.provider],
      159+ );
      160+}
      161+
      162+function LandingPillButton(props: React.ComponentProps<typeof Button>) {
      163+ return (
      164+ <Button
      165+ size="sm"
      166+ variant="ghost"
      167+ className={cn(
      168+ "h-10 rounded-full border border-border/60 bg-background/84 px-4 text-[15px] text-foreground shadow-[0_10px_30px_-24px_rgba(0,0,0,0.55)] backdrop-blur hover:bg-background/96",
      169+ props.className,
      170+ )}
      171+ {...props}
      172+ />
      173+ );
      174+}
      macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      🟠 High components/NoActiveThreadState.tsx:162

      LandingPillButton spreads {...props} after the computed className, so when callers pass className="justify-start" the default pill styles (h-10 rounded-full border...) are completely replaced instead of merged. The spread should come before the explicit className prop, or className should be omitted from the spread and merged explicitly with cn().

      +function LandingPillButton(props: React.ComponentProps<typeof Button>) {
      +  const { className, ...rest } = props;
         return (
           <Button
             size="sm"
             variant="ghost"
             className={cn(
               "h-10 rounded-full border border-border/60 bg-background/84 px-4 text-[15px] text-foreground shadow-[0_10px_30px_-24px_rgba(0,0,0,0.55)] backdrop-blur hover:bg-background/96",
      -        props.className,
      +        className,
             )}
      -      {...props}
      +      {...rest}
           />
         );
       }
      🤖 Copy this AI Prompt to have your agent fix this:
      In file apps/web/src/components/NoActiveThreadState.tsx around lines 162-174:
      
      `LandingPillButton` spreads `{...props}` after the computed `className`, so when callers pass `className="justify-start"` the default pill styles (`h-10 rounded-full border...`) are completely replaced instead of merged. The spread should come before the explicit `className` prop, or `className` should be omitted from the spread and merged explicitly with `cn()`.
      
      Evidence trail:
      apps/web/src/components/NoActiveThreadState.tsx lines 162-176 at REVIEWED_COMMIT: Shows `LandingPillButton` component with `className={cn(..., props.className)}` followed by `{...props}` spread. In JSX, props spread after an explicit attribute will overwrite matching properties, so caller-provided className will replace the computed className.
    6. Approvability

      Verdict: Needs human review

      3 blocking correctness issues found. Diff is too large for automated approval analysis. A human reviewer should evaluate this PR.

      You can customize Macroscope's approvability policy. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).

Sign in to join this conversation.