fix: code audit — error handling, parity, SPEC, tests#19
Merged
Conversation
Fixes issues #15-#18 from the 5-dimension code audit. #15 (high): providers --force now deletes custom profiles before reimport, matching bash parity. Add ProviderProfileDelete to Gateway. #16 (medium): SilenceErrors/SilenceUsage on root command (no more Cobra double-print. Check discarded errors in teardown (SandboxList, ProviderList, SandboxDelete, ProviderDelete). Return error from preflight strict mode instead of os.Exit(1). Fix providers display — show provider names and inference model after registration. #17 (medium): ANSI stripping in ProviderList (was the only parser without it). Add --kubeconfig flag to deploy, forwarded to bash. 10 new gateway CLI tests: GatewayList, SandboxList, ActiveGateway, InferenceModel, CLIVersion, CLIPath. #18 (medium): SPEC.md updated — preflight --strict + subcommands, providers --force + registration details, deploy --kubeconfig, environment variables section, Go tests documented. DRY: extract loadEnabledProviders helper (was triplicated). Validated: unit 38+7, bats 29+29, podman 19+19, OCP 17/17. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> EOF )
Skip helm deploy/teardown-k8s when the gateway is already running. Resets sandboxes + providers between runs instead of full infrastructure teardown. Falls back to full deploy if gateway is unreachable. 49s vs 137s for a full OCP test cycle (64% faster). Usage: ./test/test-flow.sh ocp --full --reuse-gateway Validated: unit 38+7, bats 29+29, podman 19+19, OCP 17/17, OCP --reuse-gateway 17/17. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This was referenced Jun 5, 2026
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
Fixes all high + medium findings from a 73-agent deep code audit, plus adds --reuse-gateway for faster OCP test cycles.
Audit fixes (issues #15-#18)
#15 (high):
providers --forcenow deletes custom profiles before reimport, matching bash parity. AddedProviderProfileDeleteto Gateway interface.#16 (medium): Error handling cleanup:
SilenceErrors+SilenceUsageon root command — no more Cobra double-printingSandboxList/ProviderListerrors instead of silently treating failures as "none found"SandboxDelete/ProviderDeleteerrors reported in teardown loopsos.Exit(1)from library code#17 (medium): Gateway CLI consistency:
ProviderList(was the only parser without it)--kubeconfigflag added to deploy, forwarded to bash for--remote#18 (medium): SPEC.md + DRY:
--strict,available/namessubcommands--force, registration details,OPENSHELL_MODEL--kubeconfig, clarified--local/--remoterequiredloadEnabledProvidershelper (was triplicated)--reuse-gateway for faster OCP tests
Skip helm deploy/teardown-k8s when the gateway is already running. Resets sandboxes + providers between runs instead. Falls back to full deploy if gateway unreachable.
49s vs 137s for a full OCP test cycle (64% faster).
Test results
Closes #15, #16, #17, #18.
🤖 Generated with Claude Code