Skip to content

Verification only for #5514 — do not merge - #5521

Open
kwakayama wants to merge 15 commits into
mainfrom
codex/pr-5514-verified
Open

kwakayama wants to merge 15 commits into
mainfrom
codex/pr-5514-verified

Conversation

@kwakayama

@kwakayama kwakayama commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Runs same-repo CI on the exact head of #5514 (87b04ec), since CI skips fork PRs. Do not merge. Closed with its branch once #5514 merges.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-13T21:16:48.190236Z 9e23e38 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

Copy link
Copy Markdown

📦 Client bundle boundary

Entrypoint Modules Source size Server leaks
src/index.client.ts 66 369 KiB ✅ 0
src/react/components/Head.tsx 5 74 KiB ✅ 0
src/react/router/index.tsx 5 74 KiB ✅ 0
src/react/context/index.tsx 5 74 KiB ✅ 0
src/react/fonts/index.ts 6 81 KiB ✅ 0
src/react/components/ui/index.ts 111 718 KiB ✅ 0
src/react/components/ui/adapter/contract.ts 1 18 KiB ✅ 0
src/react/components/ui/icons/index.ts 3 17 KiB ✅ 0
src/chat/index.ts 305 2050 KiB ✅ 0
src/chat/ag-ui.ts 61 461 KiB ✅ 0
src/chat/protocol.ts 1 11 KiB ✅ 0
src/chat/types.ts 46 246 KiB ✅ 0
src/chat/message-prep.ts 68 517 KiB ✅ 0
src/markdown/index.ts 6 30 KiB ✅ 0
src/mdx/index.ts 2 2 KiB ✅ 0
src/agent/identity-contracts.ts 1 3 KiB ✅ 0
src/schemas/index.ts 43 220 KiB ✅ 0
src/platform/env.ts 5 55 KiB ✅ 0
src/workflow/claude-code/react/index.ts 9 91 KiB ✅ 0
src/events/index.ts 31 567 KiB ✅ 0
src/events/ag-ui/public.ts 30 561 KiB ✅ 0
src/run-events/index.ts 54 321 KiB ✅ 0

A server module in a client graph aborts hydration in the browser. New leaks fail CI; known leaks are tracked in scripts/lint/client-bundle-baseline.json to burn down.

@github-actions

Copy link
Copy Markdown

@codex review

Copy link
Copy Markdown
Contributor Author

Automated review: 80/100

Good work overall. VERYFRONT_API_KEY is copied into the token slot once at load time and keeps its provenance, so the existing repository trust rules apply to it. Only minor issues remain. This PR exists only to run CI for #5514 and must not be merged. The review covers #5514's code at d3035f4.

Strengths

  • The security design holds up. The key is copied into the token slot when env files load, never read later as a fallback (applyVeryfrontApiKeyAlias). Because of that, a token the CLI deletes on purpose cannot come back through the key, and settleVeryfrontApiKeyAlias stops the SDK fallback in getHostEnv once the loader has run. A key from a .env file keeps its file provenance and its $NAME expansion taint, so a repository-steered URL handles it exactly like a VERYFRONT_API_TOKEN.
  • The edge cases are covered. The PR handles a token file appearing in a later load (revokeVeryfrontApiKeyAlias), a later project .env token replacing an earlier key alias (readExistingValueForLoad), blank token or key values, and Windows key case-folding.
  • Scope stays tight. The project-scope getEnv and the trusted project snapshot never turn a project's gateway key into the host credential (readApiTokenOrKey). VERYFRONT_API_KEY is also added to RESERVED_TASK_ENV_KEYS, PROVIDER_ENV_KEYS and the test env scrubbers.
  • The tests show regression evidence. They fail when the two core files are reset to main. Moving the MCP deploy tool to the exported MISSING_API_CREDENTIAL_MESSAGE fixes a real string-match regression that the copy change would have caused.

Concerns and suggestions (none blocking)

  • The alias state lives in two module-level variables in two modules. veryfrontApiKeyAliasSettled is in env.ts and veryfrontApiTokenAliasValue is in env-loader.ts. isVeryfrontApiTokenFromKey() also decides by comparing values, so it returns true when a user later exports the same value under VERYFRONT_API_TOKEN. The effect is cosmetic: the message names the key instead of the token. Still, consider keeping one owner for the alias state. VERYFRONT_API_TOKEN_ENV and VERYFRONT_API_TOKEN_FILE_ENV are also defined in both files. Export them once from env.ts.
  • Behavior change: a project .env key now overrides veryfront login. Apps usually keep their AI Gateway key in .env as VERYFRONT_API_KEY. With this change, that key also overrides the stored login for deploy, pull and env. The PR says this matches how a .env VERYFRONT_API_TOKEN already behaves, but the key name is far more common in app .env files, so more developers will hit it. Consider printing a one-time notice when a key from .env overrides a stored session (not only in whoami), or get explicit sign-off from the security reviewer named in feat(cli): accept VERYFRONT_API_KEY as the one credential name #5514.
  • Two generated files change without explanation. rsc-bundles.generated.ts and the docs-agent template manifest change, but the PR description does not mention either one. Confirm that the bundle diff is expected regeneration output from the pinned Deno version and not drift.
  • Some help text still mixes the two names. The MCP identity message now reads "VERYFRONT_API_KEY (or VERYFRONT_API_TOKEN or VERYFRONT_API_TOKEN_FILE)", while operator docs still name the token. That is intended, but a short "which name to use" note in docs/guides/providers.md would help readers.

CI on this head was still running when this review was written.


Generated by Claude Code

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: d3035f49c0

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@codecov

codecov Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.61905% with 5 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/provider/local/local-engine.ts 0.00% 3 Missing ⚠️
cli/commands/pull/command.ts 0.00% 1 Missing ⚠️
src/sandbox/config.ts 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@github-actions

Copy link
Copy Markdown

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: c1bafe929b

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Studio, the gateway snippets and the docs tell users to export
VERYFRONT_API_KEY, but the CLI and SDK only read VERYFRONT_API_TOKEN, so
'veryfront whoami' said 'Not logged in' with the key the user just set.

The CLI and SDK now read VERYFRONT_API_KEY too:
- After each env load, a key is copied into the VERYFRONT_API_TOKEN slot
  once, only when that slot is unset or blank, and with the key's
  provenance, so every repository trust rule judges a .env key exactly
  like a .env token (including $NAME expansion taint).
- Processes that never load env files (SDK scripts) read the key through
  getHostEnv. Once the loader has run, getHostEnv never falls back, so a
  token the CLI removed on purpose cannot come back through the key.
- VERYFRONT_API_TOKEN keeps working and wins when both are set.

Help, errors, docs and SDK examples now name VERYFRONT_API_KEY; messages
about an active credential name the variable the user actually set. The
MCP deploy tool classifies the missing-credential error by an exported
constant instead of copying its wording.

Refs veryfront/veryfront-issue-inbox#4088
Refs veryfront/veryfront-issue-inbox#4220
… hints

Codex review on 66ad121:
- P1: every test environment scrubber removed VERYFRONT_API_TOKEN but not
  VERYFRONT_API_KEY, so an exported key became an active credential in test
  children. Add the key to the Deno suite, Node/Bun runtime, preload, runtime
  E2E and binary-server scrubbers.
- P2: login messages told you to unset VERYFRONT_API_TOKEN even when the key
  supplied the credential. Name the variable you set in the rejected,
  unavailable, existing-session and invalid-warning messages, and fix the
  runs target README sample.
A token file supplies the credential ahead of VERYFRONT_API_TOKEN. Copying a
project .env key into the token slot attached the key's env-file provenance to
the token file's secret, so a repository-steered API URL could receive it.
Skip the alias while VERYFRONT_API_TOKEN_FILE is set.
…ater load

veryfront dev --project loads the cwd .env, then the project's. A key aliased
from the first load kept its env-file provenance after the second load set
VERYFRONT_API_TOKEN_FILE, so the token file's secret could be treated as
repository-supplied. Revoke the alias and its provenance whenever a token file
is set, instead of only skipping a new alias.
…in every hint

Codex review on 8d2ce9c and 59743fb:
- getHostEnv no longer falls back to VERYFRONT_API_KEY while a nonblank
  VERYFRONT_API_TOKEN_FILE is set, so an SDK process (for example
  Sandbox.create) uses the renewable token file instead of a stale key.
- The remaining missing-credential hints now say VERYFRONT_API_KEY: up,
  remote file tools, runs client, Veryfront Cloud and local providers, the
  AG-UI no-credentials error and the authentication-required suggestion.
  'veryfront config' reports apiToken (VERYFRONT_API_KEY) when the key
  supplied the token. The docs-agent template exports the key.
- Regenerate docs/guides/errors.md, the RSC bundle and the templates manifest.
withoutHostBinaryInfraEnv removed VERYFRONT_API_TOKEN but not the key. The
VFS proxy-mode E2E reloads .env after the suite scrubber, so a developer key
became the token in compiled children pointed at the real API. Add the key
to the blocklist that the VFS and compiled-binary E2E suites share.
An additional env load keeps values defined before it, and it counted the
token copied from VERYFRONT_API_KEY as one. With veryfront dev --project and
an exported key, the project's explicit VERYFRONT_API_TOKEN was skipped, which
broke token-over-key precedence and rejected same-file self-hosted pairs. The
precedence check now treats the alias as unset, so only values the user set
keep precedence.
RESERVED_TASK_ENV_KEYS stripped VERYFRONT_API_TOKEN but not the key that can
now supply it, so a task started with VERYFRONT_API_KEY copied the developer
credential into ctx.env, and verified skill scripts, which reuse the same set,
could receive it. Reserve the key alongside the token.
In a process that never loads env files, only getHostEnv saw
VERYFRONT_API_KEY. The environment snapshot carried no token, so integration
discovery and dependency write-back took the host-private branch, which
resolves VERYFRONT_API_URL first instead of VERYFRONT_API_BASE_URL. With
separate GraphQL and REST hosts, a key-only script reached a different
backend than a token-only one.

The snapshot now reads the key through readUnloadedVeryfrontApiKey, the rule
getHostEnv already used: only before the env loader resolves the key, and
never while a token file is set.
…blank token as unset

Codex review on f391d47:
- P1: the snapshot read the key fallback through the project-scoped reader,
  so inside a project env scope a project's VERYFRONT_API_KEY became the
  snapshot token and could authenticate a dependency write-back. The
  fallback now reads the host environment and never applies inside a project
  scope.
- P2: a whitespace-only VERYFRONT_API_TOKEN shadowed a valid key. A blank
  token now gives way to the key, as getHostEnv and the env loader already
  treat it. A blank token with no key is returned as before.
The bundled integrations reference still named VERYFRONT_API_TOKEN as the
platform credential for a connect. Regenerated core-skills.generated.ts.
The environment-config test wrote a temporary token file and the
sanitize-process-env test mutated Deno.env, so both needed a new
semantic disposition. The token-file rule is already covered in
env.test.ts, and the sanitize test now checks the exported key list.
@kwakayama
kwakayama force-pushed the codex/pr-5514-verified branch from c1bafe9 to 742d577 Compare November 12, 2026 12:30
@github-actions

Copy link
Copy Markdown

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: 742d5775b2

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

On Windows the env loader case-folds names, so a project .env entry
such as veryfront_api_key supplies the credential under a lower-case
name and passed the exact-match reserved check into task and skill
script env. The check now compares the upper-cased name.

Also keep the new tests on the shared test primitives: withMockFetch
and makeTempDir instead of a raw globalThis.fetch assignment and
Deno.makeTempDir, and move the sensitive key list into a module without
side effects so its test runs under Bun and Node.
withoutHostBinaryInfraEnv deleted blocked names by exact case. On
Windows a project .env can supply veryfront_api_key, which a compiled
child process reads as the credential. Match by folded name, as
buildTestProcessEnv and buildRuntimeTestProcessEnv already do.
@github-actions

Copy link
Copy Markdown

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: 87b04ecebd

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

…t service takes VERYFRONT_API_KEY

Any defined token file selector, a blank one included, is the credential: the
key never stands in for it, in the env loader's alias or the unloaded read.
The standalone agent service config takes VERYFRONT_API_KEY when
VERYFRONT_API_TOKEN is unset (token first), so registration sees a token.
@github-actions

Copy link
Copy Markdown

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9e23e38700

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +135 to +136
VERYFRONT_API_TOKEN: env.VERYFRONT_API_TOKEN ??
(env.VERYFRONT_API_TOKEN_FILE === undefined ? env.VERYFRONT_API_KEY : undefined),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Fall back to the API key when the legacy token is blank

When an agent-service deployment defines VERYFRONT_API_TOKEN as an empty string while providing a valid VERYFRONT_API_KEY, parsing fails at the token's min(1) validation before this transform runs; a whitespace-only token reaches the transform and wins because ?? treats it as present. This differs from the env loader and environment snapshot, which treat blank legacy tokens as unset, so common manifests that retain an empty deprecated variable cannot adopt the newly supported key. Normalize blank token values to undefined before validation/fallback.

Useful? React with 👍 / 👎.

VERYFRONT_PUBLIC_API_BASE_URL: v.string().url().optional(),
VERYFRONT_API_TOKEN: v.string().min(1).optional(),
// The name Veryfront tells users to set; the token wins when both are set (see `env-loader`).
VERYFRONT_API_KEY: v.string().min(1).optional(),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Update every credential guide to the new API-key name

The new agent-service key support leaves the main agent-service documentation factually stale: docs/guides/agent-service-runtime.md:66,149-155 still says registration requires VERYFRONT_API_TOKEN and uses it in the example, while docs/guides/configuration.md:272 and the skill execution description at docs/guides/agents.md:515 likewise omit VERYFRONT_API_KEY. Users following these surfaces are still directed to the deprecated name even though this change establishes the key as the user-facing credential, so update these remaining guides and examples together with the behavior change.

AGENTS.md reference: AGENTS.md:L13-L14

Useful? React with 👍 / 👎.

@sonarqubecloud

Copy link
Copy Markdown

@kwakayama

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: 9e23e38700

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

This branch has not been deployed

No deployments
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.

2 participants