Skip to content

feat: bundle pstack and run it the same way in every provider - #8

Merged
ScriptedAlchemy merged 6 commits into
mainfrom
feat/pstack-plugin
Oct 26, 2026
Merged

ScriptedAlchemy merged 6 commits into
mainfrom
feat/pstack-plugin

Conversation

@ScriptedAlchemy

@ScriptedAlchemy ScriptedAlchemy commented Oct 25, 2026 •

Copy link
Copy Markdown
Owner

Lauren Tan's pstack runs its best workflows as panels of models from different vendors. The existing ports (pstack-claude, pstack-codex) put every panel seat on one vendor's models, and their skill text drifts from upstream. Every provider inside T3 Code already has the same t3-code tools, including delegate_task to any provider and model, so T3 Code can run pstack itself.

What this does

  • Upstream pstack ships in T3 Code, off by default. packages/pstack/upstream is a byte-identical copy of upstream pstack/ 0.15.32. UPSTREAM.json pins it by commit, subtree hash, and per-file sha256, and vp run pstack:sync <cursor-plugins checkout> refreshes it. The only pack text T3 Code writes is packages/pstack/t3-code.md. It maps each Cursor tool or feature a skill names onto a t3-code tool, such as delegate_task, worktree isolation, schedule_task, watch_pull_request, request_secret, or t3_thread_*, or tells the agent to skip that step with a one-line note. checkPack fails CI when a vendored file changes, when a skill uses a Cursor term the adapter has no row for, or when a link breaks.
  • Every provider lists the same skills. The switch is in Settings → General on web and desktop and Settings → Agent behavior on mobile. While it is on, the server publishes ServerConfig.pstackSkills, and web and mobile list pstack:<skill> for every provider. A natively installed skill with the same name is hidden.
  • The server expands user mentions. When a message the user wrote mentions $pstack:<skill>, turn start and steer rewrite the mention to plain text, so native Claude skill dispatch does not run. They append a <t3_pstack> block with the pack path, the model file path, and a resolved role table. Notifications, delegated completions, and agent-written turns are left unchanged. If pstack fails, the turn still runs, with a one-line note.
  • One model file serves every provider. $pstack:setup-pstack writes <stateDir>/pstack/models.md with instance/model option=value targets. On each expansion, the server checks every role against the live provider catalog and the project's enabled providers. It fills in every option the model advertises, so delegate_task cannot copy the parent's fastMode or serviceTier into a seat. A Claude thread and a Codex thread make byte-identical delegate_task calls, which the test pstack Opus and Astra targets dispatch identically under Claude and Codex parents checks. A seat whose provider or model is unavailable runs on the parent model, the reply shows a Fallback: note, and the panel keeps its size.
  • The pack has one stable path. The server copies the pack to <stateDir>/pstack/pack/ on first use and writes a content stamp. It replaces the copy only when the content or copy layout changes. One copy runs at a time, a failed swap rolls back, and the server keeps serving the previous pack. Executable bits come from UPSTREAM.json, because file modes read from an asar archive in desktop builds drop them.

The adapter's Harnesses table has one row per built-in provider driver, and a test fails when it differs from BUILT_IN_DRIVERS. User docs are in docs/user/pstack.md, and third-party-licenses.config.json credits Lauren Tan under MIT.

Design and review

  • /pstack:architect produced the design. Claude Opus 5.5 and Codex GPT-6 Astra each drafted one, and GPT-6.1 Sol judged them. Both drafts rejected per-provider marketplace installs and native plugin injection.
  • Codex GPT-6 Astra wrote the pack, adapter, and server code. Claude Opus 5.5 wrote the web and mobile code.
  • Claude Opus 5.5 reviewed the change twice. Each finding has a fix and a regression test. The findings covered Claude option defaults, a pack failure blocking server start, the pack path changing on update, per-project provider enablement, executable bits in asar builds, and concurrent pack copies.

Verification

  • vp run check:changed origin/main passes format, lint, knip, and typecheck for 35 packages. One test fails locally and on main on macOS: ClaudeSkills.test.ts "merges plugin enablement and selects installs in native registry order". It compares /var with /private/var temp paths and passes with TMPDIR=/private/tmp.
  • node scripts/release-smoke.ts passes locally.
  • Focused suites pass: server pstack, turn start and steer, ws, MCP, client-runtime skills, and pack checks.
  • CI's Server tests 2, 3, and 5 fail on main at the same base commit, with the same errors. This PR does not touch that code.
  • A runtime check on a dev server is in this comment. A Codex thread ran $pstack:poteto-help and quoted its resolved architect runners line, which has Opus with every option filled in and inherit for the disabled Grok default.
  • Screenshots and the mobile pass are still missing. The T3 Code Browser panel was not visible, so captures returned a stale frame, and agent device access is off on that environment.

🤖 Generated with Claude Code

@changeset-bot

changeset-bot Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 9e5bf2c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@ScriptedAlchemy

Copy link
Copy Markdown
Owner Author

Runtime check (web, dev server on seeded worktree state)

  1. Settings → General → Behavior shows a new pstack row, off by default: "Offer Lauren Tan's pstack workflows as skills in every provider. Run $pstack:setup-pstack once to choose models."
  2. pstack off (baseline, same as main): on a Codex (GPT-6-Astra) composer, $pstack matches only the natively installed pstack-codex skills (bro, how, tdd, …, unprefixed).
  3. pstack on: the server materializes the pack to <stateDir>/pstack/pack/ (stamp .t3-pstack-hash; skills/show-me-your-work/scripts/log.sh is -rwxr-xr-x). $pstack:arch now offers Pstack Architect with upstream's description and the App badge.
  4. End to end on a Codex thread. Sent $pstack:poteto-help … quote the first resolved-role line (architect runners) from your t3_pstack block verbatim. The Codex agent followed poteto-help and replied:
    architect runners: [1] {"providerInstanceId":"claudeAgent","model":"claude-opus-5-5","options":[{"id":"effort","value":"xhigh"},{"id":"fastMode","value":false}]} [2] inherit
    
    • Seat 1 is upstream's claude-opus-5-5-xhigh default, mapped to the Claude instance with the complete option set; fastMode:false is filled from the real catalog.
    • Seat 2 is upstream's grok-4.7-xhigh-fast default. Grok is disabled in this environment, so the seat falls back to inherit and keeps the panel size.

Screenshots and mobile not captured. The built-in Browser panel was not visible, so captures came back as a stale frame. Agent device access is off on this environment, so the mobile pass was skipped too.

@ScriptedAlchemy

Copy link
Copy Markdown
Owner Author

CI triage for 978342a:

  • Checks and build → Exercise release workflow steps: real. scripts/release-smoke.ts copies a fixed list of workspace manifests and was missing packages/pstack. Fixed in 92b7e0e, and node scripts/release-smoke.ts passes locally.
  • Server tests 2, 3, 5: same failures as main's Fork CI on the base commit 41e63e0 (run 40234497935): thread_fork_native_prior_turn/thread_merge_back_siblings scenario idle waits, SqlError, and Codex tier start errors. Not caused by this PR.
  • Client and package tests → Test web: CommandPaletteProjectSearch.browser.test.tsx received duplicated search kinds. This PR does not touch that area. The file passes alone and in the full web suite locally (361 files, 4386 tests). It looks flaky.

ScriptedAlchemy and others added 5 commits October 25, 2026 20:14
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Byte-identical copy of github.com/cursor/plugins pstack/ (MIT, Lauren Tan),
pinned in UPSTREAM.json by commit, subtree hash, and per-file sha256.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
T3 Code ships Lauren Tan's pstack as an opt-in skill pack. The server
publishes pstack: skills to every provider's composer, expands a user's
$pstack:<skill> mention into a block naming the pack, the model file, and a
role table resolved against the live provider catalog, so a Claude thread
and a Codex thread make identical delegate_task calls and panels can mix
providers. The t3-code.md adapter maps upstream's Cursor runtime names onto
the t3-code tools, and a check keeps it covering upstream.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nfig test

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ScriptedAlchemy
ScriptedAlchemy merged commit e48798a into main Oct 26, 2026
11 of 15 checks passed
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.

1 participant