refactor(runtime): add prepared runtime foundation#78248
Conversation
|
Codex review: needs maintainer review before merge. Summary Reproducibility: not applicable. This PR is an internal foundation refactor, not a report of broken current-main behavior. Source inspection and PR tests cover the prepared-runtime contracts rather than a failing user workflow. Real behavior proof Next step before merge Security Review detailsBest possible solution: Land the additive foundation only after exact-head CI is green and maintainers confirm it stays within the staged PR 1 boundary; keep consumer migrations tracked under #77700. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR is an internal foundation refactor, not a report of broken current-main behavior. Source inspection and PR tests cover the prepared-runtime contracts rather than a failing user workflow. Is this the best way to solve the issue? Yes for the stated scope: the additive contracts and fallback-preserving helpers are a maintainable first step, while consumer migrations remain split into narrower follow-up PRs. Merge should still wait for exact-head CI and maintainer review. Acceptance criteria:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 6ce1c98b6189. |
df1a408 to
670813d
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
670813d to
e46b6cd
Compare
e46b6cd to
4769713
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
83283be to
95d7343
Compare
95d7343 to
1c31ed0
Compare
* docs(runtime): document prepared runtime guidance * refactor(provider-runtime): thread prepared provider handles * refactor(runtime-plan): add prepared runtime foundation * refactor(outbound): add prepared channel runtime facts * refactor(models): add scoped model reference helpers * refactor(plugin-sdk): expose prepared runtime helper surfaces
* docs(runtime): document prepared runtime guidance * refactor(provider-runtime): thread prepared provider handles * refactor(runtime-plan): add prepared runtime foundation * refactor(outbound): add prepared channel runtime facts * refactor(models): add scoped model reference helpers * refactor(plugin-sdk): expose prepared runtime helper surfaces
* docs(runtime): document prepared runtime guidance * refactor(provider-runtime): thread prepared provider handles * refactor(runtime-plan): add prepared runtime foundation * refactor(outbound): add prepared channel runtime facts * refactor(models): add scoped model reference helpers * refactor(plugin-sdk): expose prepared runtime helper surfaces
* docs(runtime): document prepared runtime guidance * refactor(provider-runtime): thread prepared provider handles * refactor(runtime-plan): add prepared runtime foundation * refactor(outbound): add prepared channel runtime facts * refactor(models): add scoped model reference helpers * refactor(plugin-sdk): expose prepared runtime helper surfaces
* docs(runtime): document prepared runtime guidance * refactor(provider-runtime): thread prepared provider handles * refactor(runtime-plan): add prepared runtime foundation * refactor(outbound): add prepared channel runtime facts * refactor(models): add scoped model reference helpers * refactor(plugin-sdk): expose prepared runtime helper surfaces
* docs(runtime): document prepared runtime guidance * refactor(provider-runtime): thread prepared provider handles * refactor(runtime-plan): add prepared runtime foundation * refactor(outbound): add prepared channel runtime facts * refactor(models): add scoped model reference helpers * refactor(plugin-sdk): expose prepared runtime helper surfaces
Summary
gateway-runtimeloaded registry lookup. That follow-up belongs to the startup loaded/public metadata PR tracked in Tracking: Prepared runtime resolution migration #77700.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Details
This is PR 1 in the prepared runtime resolution migration.
It introduces the shared vocabulary and typed objects that later, smaller migration PRs can consume without each surface inventing its own cache or compatibility wrapper:
AgentRuntimePlangains prepared-runtime slots for auth, prompt, tools, transcript, delivery, outcome, transport, and observability.buildAgentRuntimePlan(...)produces a reusable plan around the selected provider/model/runtime facts.ProviderRuntimePluginHandlecarries the selected provider plugin once so provider hook helpers can reuse it.The important architectural line is that this PR is foundation-only. Existing callers can still omit prepared facts. Later PRs will migrate one surface at a time to consume these objects, prove the prepared path is used, and then remove duplicate lookup branches only when their last migrated caller no longer needs them.
Real behavior proof (required for external PRs)
N/A. Maintainer-authored internal refactor foundation; no user-facing runtime path is migrated in this PR.
Root Cause (if applicable)
Regression Test Plan (if applicable)
src/agents/runtime-plan/build.test.tsUser-visible / Behavior Changes
None. This PR adds foundation contracts and guidance only. Existing runtime consumers continue to work through their current paths.
Diagram (if applicable)
Security Impact (required)
Yes, explain risk + mitigation: N/ARepro + Verification
Environment
Steps
pnpm docs:listpnpm test src/agents/runtime-plan/build.test.tspnpm buildgit diff --checkExpected
Actual
git diff --checkpassed.Evidence
Evidence is the local targeted test/build proof above. The earlier standalone PR1 build failure from referencing the later
gateway-runtimesurface was resolved by keeping PR1 scoped to existing loaded surfaces and tracking thegateway-runtimehandle lookup for PR2.Human Verification (required)
resolveProviderRuntimePluginHandle(...)does not require the latergateway-runtimesurface in this PR; unrelated dirtysystem-promptlocal files are not committed.Review Conversations
Compatibility / Migration
Risks and Mitigations