Skip to content

[codex] Fix AG-UI production Maps key baking#753

Merged
blove merged 1 commit into
mainfrom
codex/fix-ag-ui-prod-maps-key
Jul 6, 2026
Merged

[codex] Fix AG-UI production Maps key baking#753
blove merged 1 commit into
mainfrom
codex/fix-ag-ui-prod-maps-key

Conversation

@blove

@blove blove commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add the generated Maps key file replacement to the AG-UI Angular production build.
  • This makes the inject-env output participate in production bundles, not only development bundles.

Root cause

The deploy workflow set GOOGLE_MAPS_API_KEY and ran inject-env, but the Angular production configuration did not replace the committed generated-keys.ts stub with generated-keys.local.ts. As a result, production deployed a keyless bundle even when the secret was available.

Validation

  • Before the fix: dummy-key production build ran inject-env with key length 29, but the output bundle still had key length 0.
  • After the fix: GOOGLE_MAPS_API_KEY=DUMMY_MAPS_KEY_FOR_BUILD_TEST GOOGLE_MAPS_MAP_ID=DUMMY_MAP_ID_FOR_BUILD_TEST npx nx build examples-ag-ui-angular --configuration=production --skip-nx-cache, then checked output bundle key length 29 and Map ID set.
  • npx nx lint examples-ag-ui-angular (0 errors; existing warnings remain).

@blove blove enabled auto-merge (squash) July 6, 2026 17:47
@vercel

vercel Bot commented Jul 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
threadplane Ready Ready Preview, Comment Jul 6, 2026 5:49pm

Request Review

@github-actions github-actions 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.

Automated approval: this PR received an intelligent (AI) code review. See the review comments on this PR.

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Claude finished @blove's task in 51s —— View job


Code Review

  • Gather context
  • Read diff and changed files
  • Review the change
  • Post findings

The fix is correct and minimal. Here's what I verified:

Root cause was real. The development configuration in project.json already had the fileReplacements entry (lines 68–76 of the current file), but production was missing it. inject-env.mjs ran (via dependsOn) and wrote generated-keys.local.ts, but the Angular production bundler kept using the committed stub (generated-keys.ts) with empty keys.

The fix is safe in all build scenarios. inject-env.mjs always writes generated-keys.local.ts — even when GOOGLE_MAPS_API_KEY is absent it writes an empty-key file. Since inject-env is in dependsOn at the target level (not configuration-specific), it runs before every build variant. The with file will always exist at the time the bundler needs it.

Path alignment is correct. inject-env.mjs resolves the output to examples/ag-ui/angular/src/environments/generated-keys.local.ts, which matches the with value in the new fileReplacements block exactly.

No issues found. The PR does precisely what it says, is well-validated in the description, and doesn't touch any shared library surface.

@blove blove merged commit 051d4ef into main Jul 6, 2026
28 checks passed
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.

1 participant