Skip to content

feat(trellis): base states and Rebuild in Settings → Trellis - #17

Merged
Andrey170170 merged 7 commits into
dev_v2from
trellis-v2/c-base-rebuild
Oct 3, 2026
Merged

Andrey170170 merged 7 commits into
dev_v2from
trellis-v2/c-base-rebuild

Conversation

@Andrey170170

Copy link
Copy Markdown
Owner

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

  • Base states. trellis.getDetails now decodes base_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:
    • stale is marked with a warning;
    • unrecorded suggests a rebuild;
    • custom is left to the CLI.
  • Rebuild. New RPC trellis.buildBase {name} (operate scope) calls POST /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.
  • Long builds are safe to leave.
    • The server runs the build detached from the RPC, so closing the page or a dropped connection does not abort it.
    • A repeated request for the same base joins the running build: registration is atomic, so even two simultaneous first requests start only one.
    • Details report buildingBases, so a reopened page shows the build still running.
    • Details also report baseBuildFailures, so a failure is shown on the base row even if the page that asked is gone.
  • Older servers. The new detail fields default when a server omits them, so details from an older server still decode.
  • docs/user/trellis.md: one paragraph on rebuilding.

Checks

  • End-to-end: against /trellis/dev-t3 (Trellis 682a54e), the dev base went unrecorded → Rebuild → "Rebuilt dev" → current. Screenshots are kept locally in /tmp/stagec-rebuild/.
  • Tests:
    • 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, and buildingBases clears afterwards.
    • TrellisSettings.logic.test.ts: how each base state is presented.
  • Local CI: knip:check, vp check, vpr typecheck and release-smoke pass. t3 tests fail only on the known CodexInstallation and AcpSessionRuntime.processTree failures. Package tests fail only on the known desktop libsecret and snapshot file-mode failures; client-runtime, relay and mobile pass when run separately. build:desktop fails on the known libsecret helper.
  • Reviews: Codex gpt-6.1-sol (duplicate builds, lost outcomes on disconnect; fixed), then gpt-6-astra (non-atomic registration, older-server decoding, lost failure; fixed).

🤖 Generated with Claude Code

Andrey170170 and others added 4 commits October 2, 2026 16:12
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>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-03T01:25:47.820348Z 6753344 New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L labels Oct 2, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

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>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

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 };

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

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.

Andrey170170 and others added 2 commits October 2, 2026 19:20
…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>
Andrey170170 added a commit that referenced this pull request Oct 3, 2026
@Andrey170170
Andrey170170 merged commit d3df5de into dev_v2 Oct 3, 2026
8 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant