Repository navigation
Conversation
[Medium impact] The change reaches missing-key diagnostics across provider API callers and agent stop messages. The existing localization requirement must be met before merging. SummaryThe PR puts recovery steps first in the cross-organization missing-key error.
Reviews (3) · Last reviewed commit: "Put the organization name after both fix..." · Reviewed by Greptile |
… fix out of the headline
There was a problem hiding this comment.
Builder reviewed your changes and found 1 potential issue 🟡
Review Details
Incremental Code Review Summary
The latest change moves the organization name after both recovery choices, and the added long-organization-name headline test confirms the previously reported organization-name truncation is fixed. I resolved that earlier thread. The membership-scoped lookup and organization-name disclosure behavior remain unchanged.
I classified this review as high risk because the code concerns credential scope and cross-organization information. One distinct issue remains: credential keys are interpolated before the second recovery choice, and custom-provider registration accepts credential-key strings with no maximum length. A long key can therefore still truncate the headline before the switch-organization fix appears. This is separate from the fixed organization-name case.
🧪 Browser testing: Skipped — browser-test-planner agent is unavailable in this environment.
| `them, so this is an organization mismatch rather than a missing key. ` + | ||
| `Either switch your active organization back to ${holder}, or save ` + | ||
| `"${key}" in the organization this request runs in.` | ||
| `Save "${key}" in this organization, or switch your active ` + |
There was a problem hiding this comment.
🟡 Long credential keys can still hide the second recovery fix
Custom-provider registration accepts credential-key strings without a maximum length, and this interpolates the key before the switch-organization option. A sufficiently long key can push “or switch your active organization…” past the stop-headline limit; please bound/shorten the key in this diagnostic or otherwise keep both fixes visible, and add a long-key headline test.
Problem
When a run can't find a provider key it can read,
describeCredentialScopeGapadds an explanation to the "not configured" error. One case it explains: the key is saved in a different organization the person also belongs to. Credentials belong to one organization, so after someone joins a second organization, or their active organization changes, every key saved under the first one looks missing.That explanation put its fix last, after two sentences about the cause:
A chat stop shows a one-line headline of at most 240 characters, which keeps the reason's last whole sentence that fits. For this message that was the first sentence, so the headline said the key was elsewhere but never what to do. That happened even for
GITHUB_TOKENand "Builder.io". Builder's review bot flagged it on #9621, which fixed the same problem for the Personal-key message.When the organization's name can't be read, the message also said "saved in the another organization".
Approach
Same fix as #9621: the fixes come first and the explanation after.
The first sentence carries both fixes. The organization's name is the one part with no length limit, so it comes after both of them: when the headline has to cut, a long name is all it can drop.
When the organization's name can't be read, the message says "switch your active organization to one where it's saved" instead.
An earlier version of this PR named the organization before the second fix. Builder's review bot pointed out that a long name could then push that fix out of the headline; the current order is the answer to that.
What changed
packages/core/src/credentials/index.ts: the cross-organization message above.findMemberOrgHoldingCredentialnow returns{ name }(the trimmed name, ornullwhen it can't be read) rather than a pre-quoted string or the word "another", so the message can word each case.packages/core/src/credentials/scope-gap.spec.ts, renamedindex.scope-gap.spec.ts: the exact new message, the wording without an organization name, and a name with surrounding spaces. The CI check that mutates changed Core lines runs only specs named after the file they test (index.*.spec.tsforindex.ts), so under its old name it never ran these tests, and every mutant on these lines survived. The new name matchesindex.org-resolution.spec.tsbeside it.packages/core/src/agent/production-agent.spec.ts: two more cases in Stop missing-key errors blaming an integration in a person's own chat #9621's stop-headline table. A long key and a long organization name push the cause past the limit, and the headline keeps both fixes. A 125-character organization name is cut inside the name, and the headline still keeps both fixes.@agent-native/core.Safety and operations
guard:i18n-changed-copyandguard:i18n-catalogspass.Verification
On a Linux test machine, base
21c90bd, head2ba0fb3:credentials/index.scope-gap.spec.ts,provider-api/index.spec.tsandagent/production-agent.spec.ts: 930 of 930 passed.pnpm mutation:changed: 13 of 14 mutants killed, score 92.86% against a 50% bar. The survivor drops thetrim()in the check for an empty name, which changes the message only for an organization named entirely with spaces.pnpm typecheckpassed.oxlinton the changed files: no errors. Its 8 warnings are existing escapes on lines this PR doesn't touch.oxfmt --checkon the changed files passed.guard:no-oracle-looseningpassed. The scope-gap test swaps threetoContainchecks for one exacttoBe, and carries the guard'soracle-change:reason saying so.guard:i18n-changed-copyandguard:i18n-catalogspassed.New and changed tests:
GOOGLE_APPLICATION_CREDENTIALS_JSONin an organization called "Builder.io Developer Relations and Community Programs" keeps both fixes and drops the cause.Not checked live: the message in a real chat on beta, which needs the deploy after merge.
Review focus
🤖 Generated with Claude Code