Skip to content

refactor(simplify): streamline vault matching and persistent flags - #2195

Open
rspurgeon wants to merge 1 commit into
mainfrom
gh-2191
Open

rspurgeon wants to merge 1 commit into
mainfrom
gh-2191

Conversation

@rspurgeon

Copy link
Copy Markdown
Collaborator

AI Gateway vault matching repeats an ID extraction that marshals the same
resource to JSON. Compute the ID once and return early when it is empty,
while preserving ID-first matching and the name fallback. Reuse a local
persistent flag set when registering extension flags.

Behavior and tests are unchanged.

Validation: CGO_ENABLED=0 go fix ./..., make format (no changes),
make build, and make test-all (lint, installer, unit, E2E metrics,
and integration tests).

Closes #2191.

@rspurgeon
rspurgeon requested review from a team as code owners September 16, 2026 03:56
@kong-api-ops
kong-api-ops Bot requested a review from a team September 16, 2026 03:56
@kong-api-ops

kong-api-ops Bot commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

KSAI Review: Finished

  1. 04:04 UTC Reviewing changed source files against the submitted diff
  2. 04:14 UTC Cross-checking review findings against related code paths

Run report (federated) · 1 paid run · $0.0105 total
# Engine Result Model Turns Cost
1 opencode success zai-org/GLM-5.3-Flash/high 6 $0.0104

Reviewing cost $0.0104; deciding how to run it cost $0.0001

@kong-api-ops kong-api-ops Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check Result
Scope Two refactor hunks: Konnect vault matching in internal/declarative/resources/ai_gateway_vault.go and persistent flag registration in internal/extensions/persistent_flags.go
Mandate go-code-reviewer (adversarial Go, diff focus)
Findings 1 Low
Findings audit Completed

Both hunks are behavior-preserving: truth-table comparison of old and new TryMatchKonnectResource logic matches on all inputs, and the hoisted flag set is identical across calls. No additional concerns found in the secrets, security, or leak passes.

Comment thread internal/extensions/persistent_flags.go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[simplifier] Simplify recently modified declarative and extension code

1 participant