Repository navigation
feat(trellis): base states and Rebuild in Settings → Trellis - #17
Conversation
Bases show whether they were built from their current definition (Trellis base_states) and can be rebuilt from their built-in definition through a new trellis.buildBase RPC (POST /v1/bases/build, operate scope); custom bases are left to the CLI. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…; Settings shows builds already running Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…tached build's failure; older servers' details still decode Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dd2625158a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const existing = baseBuilds.get(name); | ||
| if (existing !== undefined) return existing; | ||
| baseBuilds.set(name, fresh); | ||
| baseBuildFailures.delete(name); |
There was a problem hiding this comment.
Clear retained failures after an external rebuild
When a T3-triggered build fails and the same base is later rebuilt successfully through the Trellis CLI—or a lost RPC response hides a successful build—refreshed status can report current, but this map is cleared only when another trellis.buildBase RPC starts. details therefore keeps returning the old failure and TrellisBaseRows prioritizes it over the current state, leaving a false warning indefinitely; reconcile retained failures when the reported base state advances or the Trellis instance changes.
AGENTS.md reference: AGENTS.md:L158-L164
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Valid: a retained failure is now dropped as soon as Trellis reports that base as current (rebuilt from the CLI, or a build whose answer was lost), so details stop warning. Test added in TrellisCatalog.test.ts. Fixed in 2f9af97.
…s current Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2f9af97a63
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| baseBuildFailures: Object.fromEntries( | ||
| [...baseBuildFailures].filter(([base]) => { | ||
| // Rebuilt since (from the CLI, or an answer that was lost): no longer failed. | ||
| if (details.baseStates?.[base] !== "current") return true; |
There was a problem hiding this comment.
Preserve failures when rebuilding a current base fails
The new reconciliation creates the inverse of the previously reported stale-failure case: if a base is already current and the user rebuilds it, an atomic build failure leaves the old base's state as current, so the next details read immediately deletes the newly recorded failure. The initiating page may show a toast, but reconnecting or reopening Settings loses the failure that baseBuildFailures is intended to retain; only clear it after observing evidence that the state advanced after the failed attempt.
AGENTS.md reference: AGENTS.md:L164-L164
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Valid: the failure now records the base's state as last read when it failed, and is dropped only when a later build through T3 succeeds or Trellis reports the base in a different state (e.g. stale → current after a CLI rebuild). A failed rebuild of an already-current base stays reported. Test updated. Fixed in 6753344.
| rebuildable: false, | ||
| }; | ||
| default: | ||
| return { description: null, warn: false, rebuildable: true }; |
There was a problem hiding this comment.
Hide Rebuild when the server does not expose it
When the current web client connects to a pre-change T3 server, the compatibility default decodes the absent baseStates field as null, but this branch marks every base rebuildable. The old server does not have the new trellis.buildBase RPC, so Settings presents buttons whose clicks necessarily fail; the same misleading control appears when a new T3 server talks to an older Trellis without the build endpoint. Gate the control on an advertised capability rather than treating an unreported state as rebuildable.
AGENTS.md reference: AGENTS.md:L27-L29
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Declining: each T3 instance is installed from one pinned build (t3code-install pins an exact version per instance), so web and server always match and a client never talks to a server without trellis.buildBase; the store and app.t3.codes clients don't speak dev_v2's protocol at all. A Trellis without POST /v1/bases/build answers with its route-missing error, shown as the rebuild's toast.
There was a problem hiding this comment.
Partly taken after all: the Trellis half was cheap to cover. base_states and POST /v1/bases/build came in the same Trellis change, so Rebuild now appears only when the details report base states; a T3 server talking to an older Trellis shows none. The older-T3-server half stays declined for the pinned-build reason above. 92282cb.
…or the base's state changes Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…came with its build endpoint Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Trellis v1 Stage C, Lane T3 step 3 part 2 (first piece): base states and rebuild in Settings → Trellis. History settings and the preview host follow in their own PRs as their Trellis APIs land.
Change
trellis.getDetailsnow decodesbase_states(Trellis Improve terminal navigation shortcuts and streamline git action PR flow pingdotgg/t3code#42). Each base row says whether the base was built from its current definition:staleis marked with a warning;unrecordedsuggests a rebuild;customis left to the CLI.trellis.buildBase {name}(operate scope) callsPOST /v1/bases/build {name}, which builds from the base's built-in definition. A Rebuild button on each base row shows "Rebuilding…" while it runs, then a toast. New workspaces start from the rebuilt base; existing ones keep their environment.buildingBases, so a reopened page shows the build still running.baseBuildFailures, so a failure is shown on the base row even if the page that asked is gone.docs/user/trellis.md: one paragraph on rebuilding.Checks
/trellis/dev-t3(Trellis 682a54e), thedevbase wentunrecorded→ Rebuild → "Rebuilt dev" →current. Screenshots are kept locally in/tmp/stagec-rebuild/.Trellis.test.ts: base states decoded, and a build that succeeds and one that Trellis refuses.TrellisCatalog.test.ts: a build outlives its interrupted caller, a repeated request joins it, concurrent first requests start one build, andbuildingBasesclears afterwards.TrellisSettings.logic.test.ts: how each base state is presented.knip:check,vp check,vpr typecheckandrelease-smokepass.t3tests fail only on the knownCodexInstallationandAcpSessionRuntime.processTreefailures. Package tests fail only on the known desktop libsecret and snapshot file-mode failures; client-runtime, relay and mobile pass when run separately.build:desktopfails on the known libsecret helper.🤖 Generated with Claude Code