fix(e2e): fill the API key on the tab that actually holds it - #663
Merged
Conversation
respond went 0/6 on the first run to reach the LLM call. Reading the daemon.yaml each agent process was handed: openclaw/opencode LLM_API_KEY + LLM_BASE_URL=<gateway> + LLM_MODEL ok codex OPENAI_BASE_URL=api.openai.com, no key no claude ANTHROPIC_BASE_URL=api.anthropic.com, no key no gemini GOOGLE_GEMINI_BASE_URL=<google>, no key no Those three are the dual-auth agents, and their Configure dialog opens on the CLI sign-in tab. Radix unmounts the tab that is not selected, so the key form is not in the DOM at all — the spec enumerates `agent-config-*`, finds only the CLI tab's model fields, and fills no key. Save then writes every field's stored default regardless of the tab, which is where the official base URLs came from, and the key field is optional on an agent that could equally be signed in, so nothing objected: the dialog closed, connect passed, and the agent started with no credential. So the spec now selects the API-key tab before it enumerates, and fails loudly when no `*_API_KEY` input was filled. Silently saving an empty key is what made this look like a gateway or model problem for two rounds. Also here, all from the same run's evidence: - Attachments are redacted. daemon.yaml holds the instance env verbatim, so the raw file put the gateway key and the workspace token into artifacts that outlive the run. - The isolated HOME now sets HOMEDRIVE/HOMEPATH as well as USERPROFILE. openclaw's auth store was found under the real profile during a run whose HOME was a temp dir, and a tool reading the older pair is the shape of that. - The daemon's exit log says how long the process lived, and words a clean stop apart from a failure. "exited early" was asserted, not measured: the handler outlives the spawn, so an intentional stop minutes in printed the same alarming line as a spawn that died on the spot, and every daemon.log carried one. Product side is two data-testid attributes on the auth tabs and the daemon log wording. No behaviour change, so no version bump.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Follow-up to #662. That one got
connectto 5/6 — the first run to reach an actual LLM call — which is what exposed this.The respond 0/6 root cause is in the spec, not in the adapters
The run's
daemon.yaml(the env each agent process was really handed):LLM_API_KEY+LLM_BASE_URL=<gateway>+LLM_MODELOPENAI_BASE_URL=https://api.openai.com/v1+ model, no keyANTHROPIC_BASE_URL=https://api.anthropic.com+ model, no keyGOOGLE_GEMINI_BASE_URL=https://generativelanguage.googleapis.com, no keyThose three are exactly the dual-auth agents, and their Configure dialog opens on the CLI sign-in tab (
useState<"cli" | "key">("cli")). Radix unmounts the tab that is not selected, so the API-key form is not in the DOM: the spec enumerates[id^="agent-config-"], finds only the CLI tab's model fields, and fills no key.save()then writes every field's stored default whatever the tab shows — which is where the official base URLs came from — and the key field isrequired: falseon an agent that could equally be signed in, so the required-field guard did not object either. The dialog closed, connect passed, and the agent started with no credential.Two rounds of reports read this as a gateway problem. It never was: those three requests never left the machine.
Fix: select the API-key tab before enumerating, and throw when no
*_API_KEYinput was filled. Saving an empty key silently is the part that cost the time, so it is now a loud failure with the field ids it did see.Product side for this is two
data-testidattributes on the tab triggers — the tab labels are translated, so there was no stable handle.Also here, all from the same run's evidence
daemon.yamlcarries the instance env verbatim, so the raw attachment put the gateway key and the workspace token into artifacts that outlive the run. Only the values this test knows are secret are masked, so the attachment stays diagnosable.HOMEDRIVE/HOMEPATHalongsideUSERPROFILEin the isolated HOME. openclaw's auth store turned up under the real profile during a run whose HOME was a temp dir, and a Windows tool resolving home from the older pair is the shape of that. Unproven — it is hardening in the right place, not a confirmed diagnosis.exited earlywas asserted, not measured: the handler outlives the spawn, so a deliberate stop minutes in printed the same alarming line as a spawn that died on the spot — which is why everydaemon.login the run carried one with nothing to date it. The failure wording keeps matchinglog-parser's error regex; a clean stop deliberately no longer does.Testing
npm run typecheck— cleannpx vitest run— 48 files, 476 tests, all passingStill open after this
/v1/chat/completionsin under a second, so this one needs its own investigation.requires legacy credential migration; run openclaw doctor --fix. Whether theHOMEDRIVEchange removes it is a question for the next run.Approval mode overridden to "default" because the current folder is not trustedis untouched; itsInvalid auth method selectedshould go with the key fix.daemon.log. If anything there matchesexited early, that string is gone now.🤖 Generated with Claude Code