Skip to content

feat(trellis): profile instructions through the provider's primer - #24

Merged
Andrey170170 merged 3 commits into
dev_v2from
trellis-v2/c-primer-provider
Oct 3, 2026
Merged

Andrey170170 merged 3 commits into
dev_v2from
trellis-v2/c-primer-provider

Conversation

@Andrey170170

Copy link
Copy Markdown
Owner

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 as launch.instructions), with TRELLIS_INSTRUCTIONS=t3 in the session's environment so trellis launch does not add them again. T3 requested the primer without a provider, so profile instructions were missing from Trellis threads.

Change

  • Provider in the primer request: Trellis.primer(target, provider?); the runtime policy asks for claude or codex, matching the thread's driver.
  • Marker: launch.env gets TRELLIS_INSTRUCTIONS=t3 only when the primer arrived. If the primer request fails, the session starts without it (as before) and trellis launch adds the profile instructions itself, so they are not lost.
  • Shared Codex app-server: a thread's developer_instructions in its own thread config overrides what the shared process was launched with, so threads don't get the instructions twice.
  • Older Trellis: it ignores provider and the marker; both arrived in the same Trellis change, so nothing changes there.

Checks

  • Tests: TrellisRuntimePolicy.test.ts covers the primer requested per provider, the marker in launch.env, and no marker plus the guide alone when the primer fails.
  • 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.
  • Review: Codex gpt-6.1-sol found that a primer failure dropped the instructions; fixed.

🤖 Generated with Claude Code

Andrey170170 and others added 2 commits October 2, 2026 21:10
…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>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 3, 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-03T03:35:24.402371Z 6cb5407 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:M labels Oct 3, 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: 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" } : {}),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

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 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>
@Andrey170170
Andrey170170 merged commit 28cd250 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:M 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