Repository navigation
S10.A2.b: BYO end-to-end deployment + raw_env - #67
Merged
Merged
Conversation
Pal Lakatos-Toth (pallakatos)
force-pushed
the
phase2-multi-runtime-byo
branch
from
April 28, 2026 13:01
79448e1 to
81b591b
Compare
Promotes RuntimeKind::BYO from 'unwired (returns AdapterMissing)' to end-to-end Pod deployment with documented contract. - RuntimeDeploymentPlan gains raw_env: Vec<serde_json::Value> for structural valueFrom passthrough (static value: entries continue via runtime_extra_env BTreeMap). - plan_byo populates both runtime_extra_env (flat) and raw_env (structural). Reserved-prefix / NUL / dup name filter applies to raw_env entries. - Reconciler skips OPENCLAW_*/FOUNDRY_AGENT_* env when is_byo. Critical: OPENCLAW_GATEWAY_TOKEN references the gateway-token Secret which is OpenClaw-namespace-scoped; BYO referencing it would CreateContainerConfigError. - Agent container extracted into a json! binding before the deployment macro. Conditional fields: name (agent vs openclaw), Tests: 307/307 controller pass (+1 = build_runtime_plan_dispatches_ byo_to_producer). Clippy + fmt clean. Audit: docs/security-audits/2026-04-28-phase2-multi-runtime-byo.md. Stacks on PR #66 (S10.A2 dispatch seam). Rebase or land sequentially. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Pal Lakatos-Toth (pallakatos)
force-pushed
the
phase2-multi-runtime-byo
branch
from
April 28, 2026 13:10
81b591b to
4a277b7
Compare
This was referenced Apr 28, 2026
Pal Lakatos-Toth (pallakatos)
added a commit
that referenced
this pull request
May 12, 2026
Promotes RuntimeKind::BYO from 'unwired (returns AdapterMissing)' to end-to-end Pod deployment with documented contract. - RuntimeDeploymentPlan gains raw_env: Vec<serde_json::Value> for structural valueFrom passthrough (static value: entries continue via runtime_extra_env BTreeMap). - plan_byo populates both runtime_extra_env (flat) and raw_env (structural). Reserved-prefix / NUL / dup name filter applies to raw_env entries. - Reconciler skips OPENCLAW_*/FOUNDRY_AGENT_* env when is_byo. Critical: OPENCLAW_GATEWAY_TOKEN references the gateway-token Secret which is OpenClaw-namespace-scoped; BYO referencing it would CreateContainerConfigError. - Agent container extracted into a json! binding before the deployment macro. Conditional fields: name (agent vs openclaw), Tests: 307/307 controller pass (+1 = build_runtime_plan_dispatches_ byo_to_producer). Clippy + fmt clean. Audit: docs/security-audits/2026-04-28-phase2-multi-runtime-byo.md. Stacks on PR #66 (S10.A2 dispatch seam). Rebase or land sequentially. Co-authored-by: Pal Lakatos-Toth <pallakatos@microsoft.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Promotes
RuntimeKind::BYOfrom "unwired (returnsAdapterMissing)" to end-to-end Pod deployment with a documented contract. BYO sandboxes now reach Running state with the agent container shaped correctly for non-OpenClaw runtimes.Stacks on #66 (S10.A2 dispatch seam). Diff against
devwill look bigger than the actual A2.b delta until #66 merges. Net A2.b changes: +411 / -97 across 4 files.What changed
controller/src/reconciler/runtime.rspub raw_env: Vec<serde_json::Value>onRuntimeDeploymentPlan— captures structural env entries (e.g.valueFrom: secretKeyRef:).RuntimeKind::BYOnow routes throughOk(plan_byo(cfg))(wasAdapterMissing).plan_byopopulates bothruntime_extra_env(flatvalue:entries) andraw_env(structural entries). Reserved-prefix / NUL / dup name filter applies toraw_env.plan_returns_adapter_missing_for_each_non_openclaw_kindrenamed →...for_each_unwired_non_openclaw_kind(BYO removed from cases vec);plan_byo_skips_value_from_env_entriesextended to assertraw_envpopulated; newbuild_runtime_plan_dispatches_byo_to_producer.controller/src/reconciler/mod.rsis_byoflag derived fromruntime_spec.kind.is_byo:OPENCLAW_MODEL,OPENCLAW_GATEWAY_TOKEN,FOUNDRY_DEPLOYMENTS,FOUNDRY_AGENT_ID,FOUNDRY_AGENT_TOOLS. Critical:OPENCLAW_GATEWAY_TOKENreferences thegateway-tokenSecret which is OpenClaw-namespace-scoped — a BYO Pod referencing it wouldCreateContainerConfigError.raw_envconsumption block added after the existingruntime_extra_envblock; defensive skip on entries missingname.name:agent(BYO) vsopenclaw(OpenClaw).command/argsset fromplan.command/plan.argswhenSome(...).Threat model highlights
gateway-tokenSecret doesn't existis_byois_byo/agt/trust/*is_byo(defense in depth: router admin endpoints already bind 127.0.0.1 + require admin token)raw_envvalueFromraw_enventries'namefieldopenclaw→agentbreaks toolingazureclaw connectuses port-forward by deployment + port name; post-deployment patches atmod.rs:1102-1160targetinference-routerby name lookup — both unaffected (verified by inspection)valueFromsecretKeyRefis namespace-local; BYO sandboxes have their own namespaceazureclaw-<name>with nogateway-tokenSecret provisioned — wouldCreateContainerConfigErrorTests
cargo test --package azureclaw-controller: 307/307 pass (was 306 in S10.A2; +1 =build_runtime_plan_dispatches_byo_to_producer).cargo clippy --package azureclaw-controller --all-targets -- -D warnings: clean.cargo fmt --all -- --check: clean.Out of scope (deferred)
RuntimeReadyCondition; Phase 3).agentCode: configMapandagentCode: inline(onlyoci+gitin Phase 2).OpenAIAgents/MicrosoftAgentFrameworkruntime wiring → S10.A3 / S10.A4.127.0.0.1:8443. Documented in CRD comment + reference. Convenience helper deferred.Audit doc
docs/security-audits/2026-04-28-phase2-multi-runtime-byo.md— full scope / threat model / invariants preserved / test matrix / sign-off / follow-ups.§14.6 column movement
Column 11 (Multi-runtime hosting) — partial credit. The BYO half of the column-11 ✓ bar (BYO with documented contract) lands here. Full ✓ requires S10.A4 (the second native non-OpenClaw runtime).
Follow-ups (not this PR)
openai-agents+ adapter).phase2-platform-mcp-server) — Foundry-shim platform MCP server in router. Should ship before S10.A3/A4 so adapters become trivial.🤖 Co-authored with Copilot CLI