refactor(gateway): remove the separate mutation feature flag - #2402
Conversation
|
Claude Security Review: no high-confidence findings. (run) |
There was a problem hiding this comment.
AgentCore Harness Review
Verdict: Looks good
Nice consolidation. The retired imperative-mutation-commands key is handled cleanly end-to-end:
- Removed from
globalConfigFileSchema, so Zod strips it on read (backward-compat for existing config files, including the previously-rejected"true"string form — covered by the parameterized test). diff()inDefaultGlobalConfigAccessor.setnaturally drops it on the next write since it only iterates keys present inDEFAULT_GLOBAL_CONFIG.- The
configCLI handler rejects reads/writes of the retired key via itsz.enum(getKeys(DEFAULT_GLOBAL_CONFIG))argument schema.
The added gateway.name() === "gateway" guard in GatewayCreateScreen is a real fix: when imperative-commands is off, resolveCommand walks off the tree and returns the root command, whose create child would otherwise cause the screen to incorrectly render CliOnlyScreen. The test in gateway.mutations.screen.test.tsx (“disabled direct create opens project guidance and returns to root”) exercises exactly this path.
Test coverage looks thorough (both flag states, legacy on-disk values, help/menu registration, project-guidance routing), no new mocking concerns, and no telemetry gap since this is a pure refactor.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## refactor #2402 +/- ##
============================================
- Coverage 97.25% 97.25% -0.01%
============================================
Files 612 612
Lines 41019 40986 -33
============================================
- Hits 39893 39860 -33
Misses 1126 1126 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| globalConfigAccessor: new TestGlobalConfigAccessor({ | ||
| initialConfigData: IMPERATIVE_GLOBAL_CONFIG, | ||
| }), | ||
| globalConfig: IMPERATIVE_GLOBAL_CONFIG, |
There was a problem hiding this comment.
this still looks so strange to me, but I know it requires so re-wiring so OOS here.
Description
Remove
imperative-mutation-commandsso Gateway mutations use the same default-offimperative-commandsgate as the other standalone resource commands. This eliminates the overlapping settings and the extra config plumbing through Gateway factories. Existing config files tolerate the retired key, and tests cover availability, help, project guidance, and config compatibility.Related Issue
Refs #2400. Follow-up to #2396.
Documentation PR
Not applicable: these internal opt-in settings are not part of the public command reference.
Type of Change
config.Testing
3,559 tests passed with 98.00% line coverage. Also passed 59 built-CLI smoke checks covering both parent-flag states, existing retired-key values, all 12 Gateway mutations, and config reads/writes.
bun testbun run test:e2e, or explained why they are not applicablebun run typecheckbun run lint:checkbun run format:checkbun run buildsrc/assets/, I updated affected snapshots withbun test <test-file> --update-snapshotsand committed themAWS deployment E2E tests are not applicable: no deployment logic or AWS request semantics changed. Fixture-backed command tests and TUI tests ran in the full suite. No assets changed.
Checklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the
terms of your choice.