Repository navigation
fix(supervisor): reject at startup an --envoy-arg that repeats a flag the supervisor sets (#1375, #1376) - #1399
Conversation
… the supervisor sets (#1375, #1376) The pinned Envoy refuses a flag given twice ("Argument already set!"), so an --envoy-arg that repeated a flag the supervisor passes itself failed every fork. Only --admin-address-path was refused at startup. The flags now live in one table next to the code that builds the Envoy command line (hotrestart/envoyargs.go). CheckExtraArgs refuses each of them in ExtraArgs, in the "--flag value" and "--flag=value" spellings, with an error naming the flag and the supervisor option or chart value that owns it: -c/--config-path, --base-id, --restart-epoch, --drain-time-s, --parent-shutdown-time-s, --admin-address-path, and --mode (set by the bootstrap validation run). A test reads the flags off the command lines the supervisor builds and fails when one is not reserved. --concurrency stays allowed (the chart passes it for proxy.concurrency), but a second one is refused the same way. concurrencyArg no longer returns the last of several values: Envoy never keeps the last, so it now returns an error, and the comment that said otherwise is corrected. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
There was a problem hiding this comment.
🟡 Changes recommended
Adjacent repeated --concurrency arguments can still bypass startup validation and cause every Envoy fork to fail.
1 open finding
What changed in this PR
Adds supervisor startup checks for conflicting Envoy arguments, addressing #1375 and #1376 before failures reach proxy launches.
Changes:
- Centralizes supervisor-owned Envoy flags and rejects conflicting extra arguments.
- Rejects repeated
--concurrencysettings. - Adds regression tests, drift guards, and operator documentation.
| File | Description |
|---|---|
| docs/runbook.md | Links to reserved-flag documentation. |
| docs/configuration.md | Documents startup argument restrictions. |
| agent/internal/supervisorcmd/supervisor.go | Delegates validation and updates flag help. |
| agent/internal/supervisorcmd/flags_test.go | Tests startup checks and chart arguments. |
| agent/internal/proxy/hotrestart/supervisor.go | Shares flag constants across command construction. |
| agent/internal/proxy/hotrestart/envoyargs.go | Defines reserved flags and validation. |
| agent/internal/proxy/hotrestart/envoyargs_test.go | Adds validation tests and drift guards. |
| agent/internal/proxy/hotrestart/concurrencychange.go | Detects repeated concurrency settings. |
| agent/internal/proxy/hotrestart/concurrencychange_test.go | Updates concurrency parsing coverage. |
| agent/internal/proxy/hotrestart/BUILD.bazel | Registers new source and test files. |
🧠 Review effort: Balanced
Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.
…be as a repeat concurrencyArg skipped the argument after "--concurrency" as its value, so "--concurrency --concurrency 2" and "--concurrency --concurrency=4" were a bad value, not a repeat, and the startup check let them through. The value is now read without being skipped. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
There was a problem hiding this comment.
🟢 Approval recommended
The focused changes address the reported failures with regression coverage and no unresolved blocking findings.
0 open findings
1 resolved since last review
🧠 Review effort: Balanced
Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.
There was a problem hiding this comment.
🟢 Approval recommended
The focused duplicate-flag changes preserve command construction and have targeted regression coverage, with no identified new blocking defect.
0 open findings
🧠 Review effort: Balanced
Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.

Closes #1375
Closes #1376
The problem
The supervisor passes some Envoy flags itself on every fork. The pinned Envoy refuses a flag given twice (
PARSE ERROR: Argument: (--base-id) Argument already set!). So an--envoy-argthat repeated one of them passed the startup check and then failed every fork. Only--admin-address-pathwas refused at startup.What changed
agent/internal/proxy/hotrestart/envoyargs.goholds the flags the supervisor passes, as constants, and a tablereservedEnvoyFlagswith what owns each one.buildEnvoyCmdand the--mode validaterun now build their command lines from the same constants.hotrestart.CheckExtraArgsrefuses each reserved flag in--envoy-arg, in the--flag valueand the--flag=valuespellings. The error names the flag and the supervisor option or chart value to change instead.supervisorcmd.checkEnvoyArgscalls it at startup, as before.-c/--config-path,--base-id,--restart-epoch,--drain-time-s,--parent-shutdown-time-s,--admin-address-path, and--mode.--modeis on the list because the supervisor passes--mode validatewhen it checks a changed bootstrap.--concurrencystays allowed once. The chart passes it forproxy.concurrency. A second--concurrencyis refused at startup with an error that namesproxy.concurrency.concurrencyArgused to return the last of several--concurrencyvalues, and its comment said Envoy's parser keeps the last. It does not.concurrencyArgnow returns an error for a repeat (errRepeatedConcurrency) and the comment says what Envoy does. One existing test case (--concurrency 2 --concurrency=3gives 3) changed to expect that error.docs/configuration.mdlists the reserved flags;docs/runbook.mdpoints to it; the--envoy-arghelp text says the same.Nothing under
charts/changed. No dependency was added.The drift guard
TestEveryFlagTheSupervisorPassesIsReservedreads the flags off the command lines the supervisor really builds and requiresCheckExtraArgsto refuse each one.TestReservedFlagsAreAllPassedOrAliaseschecks the other direction. I removed the--restart-epochentry from the table as a temporary mutation: both tests failed, then passed again with the entry back.Measured
//agent/test/envoybin:envoy_binextracts, run with--mode validate): each of--concurrency,--base-id,-c,-cplus--config-path,--mode,--restart-epoch,--drain-time-s,--parent-shutdown-time-s,--admin-address-pathgiven twice answersArgument already set!.agent/internal/supervisorcmd/flags_test.goran first against the unchanged check: 21 of the 24 flag/spelling subtests failed (the 3 for--admin-address-pathalready passed), all 8 duplicate---concurrencysubtests failed, and the chart test failed on its control. All pass with the change.TestChartEnvoyArgsPassTheCheck(new, committed) takes every--envoy-argitem in the DaemonSet template, all conditional branches at once, through the check. By hand, I also renderedcharts/aetherwithhelm templatetwice and ran the proxy container's--envoy-arglist throughcheckEnvoyArgsin a temporary test (not committed):-l info --service-cluster aether-proxy --service-node $(NODE_NAME) --service-zone $(ZONE) --drain-strategy gradual— accepted;proxy.concurrency=2,proxy.hotRestart.{baseId=3,drainTime=20s,parentShutdownTime=30s,skipParentStats=true,hotRestartOnConcurrencyChange=true},proxy.logLevel=debug,otel.endpointset: the same plus--concurrency 2 --skip-hot-restart-parent-stats— accepted.bazel test //agent/internal/supervisorcmd:all //agent/internal/proxy/hotrestart:all //agent/cmd/proxy-supervisor:allpasses, includingdeps_test.scripts/check-proxy-supervisor-deps.shpasses. The two touchedgo_testtargets pass under--config=race. The lint build withfail_on_violationandmake format-checkpass.Limits, and what I did not verify
--service-nodenamed-c) is refused too. I judged that acceptable; it is documented onCheckExtraArgs.--flag=valuespelling at all:--concurrency=2and--base-id=3answerCouldn't find match for argument(measured). The check refuses that spelling for reserved flags as asked. It does not refuse--concurrency=N, whichconcurrencyArgstill parses although Envoy would reject it. I left that alone as a separate finding.🤖 Generated with Claude Code
https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr