Repository navigation
feat(trellis): profile instructions through the provider's primer - #24
Conversation
…llis launch skips profile instructions The primer request names the provider, so it carries that provider's agent profile instructions, and launch.env sets TRELLIS_INSTRUCTIONS=t3 so trellis launch does not add them a second time. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… launch 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: e3ca912a7e
ℹ️ 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".
| // launch` must not add them a second time; without a primer it | ||
| // adds them itself. (A Codex thread's instructions in its own | ||
| // config override what its shared process was launched with.) | ||
| ...(Option.isSome(primer) ? { TRELLIS_INSTRUCTIONS: "t3" } : {}), |
There was a problem hiding this comment.
Preserve Codex profiles when a later primer request fails
When a Codex primer request fails after another thread has already started the workspace's shared app-server from a successful primer, omitting this variable cannot make trellis launch add the profile instructions because that launch already occurred with TRELLIS_INSTRUCTIONS=t3. The fallback consequently supplies only TRELLIS_T3_GUIDE, and codexThreadRuntimeParams uses that to override the affected thread's developer_instructions, silently dropping its profile. The inverse ordering can also retain or duplicate the first thread's profile because Codex config reads include the app-server's current CLI overrides (Codex config loading). The failure fallback therefore needs to be handled per Codex thread rather than by toggling process-only launch environment.
AGENTS.md reference: AGENTS.md:L69-L72
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Valid: a Codex thread's developer_instructions replace those of the workspace's shared app-server, which may have been launched with the marker for another thread. So for Codex a failed primer request now refuses the turn start ("Try again in a moment") instead of starting without the profile instructions; Claude, which runs one process per session, keeps the trellis launch fallback. Test added. Fixed in 6cb5407.
…the profile's instructions Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Lane T3 follow-up for the Env lane's agent profiles (Trellis pingdotgg#47–pingdotgg#53,
docs/api.md"Instructions").Problem
An agent profile's instructions reach a session once. Under T3 that is through the primer (
GET /v1/primer?provider=, delivered aslaunch.instructions), withTRELLIS_INSTRUCTIONS=t3in the session's environment sotrellis launchdoes not add them again. T3 requested the primer without a provider, so profile instructions were missing from Trellis threads.Change
Trellis.primer(target, provider?); the runtime policy asks forclaudeorcodex, matching the thread's driver.launch.envgetsTRELLIS_INSTRUCTIONS=t3only when the primer arrived. If the primer request fails, the session starts without it (as before) andtrellis launchadds the profile instructions itself, so they are not lost.developer_instructionsin its own thread config overrides what the shared process was launched with, so threads don't get the instructions twice.providerand the marker; both arrived in the same Trellis change, so nothing changes there.Checks
TrellisRuntimePolicy.test.tscovers the primer requested per provider, the marker inlaunch.env, and no marker plus the guide alone when the primer fails.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