Skip to content

fix: preserve full stop in credential status line when no model count… - #6470

Closed
Amanjha2005 wants to merge 2 commits into
Agenta-AI:mainfrom
Amanjha2005:fix/6443-status-line-punctuation
Closed

Amanjha2005 wants to merge 2 commits into
Agenta-AI:mainfrom
Amanjha2005:fix/6443-status-line-punctuation

Conversation

@Amanjha2005

@Amanjha2005 Amanjha2005 commented Sep 1, 2026 •

Copy link
Copy Markdown

… follows

Fixes #6443

Summary

Moved where the trailing full stop gets stripped from the provider's status message, inside credentialStatusLine() in cardCopy.ts.

The old code stripped the full stop from every message, always — even when nothing was going to be appended after it. When a key was rejected, this caused the message to show as "OpenAI rejected this key (401)Nothing has been saved." with no space or punctuation between the two sentences.

The full stop should only be stripped when a "· N models fetched" suffix is about to be added right after it — that's the actual reason the strip exists. Now the strip only happens inside the branch where modelCount is not null. When modelCount is null, the message is returned untouched, full stop included.

Testing

Verified locally

Ran the existing unit test suite for this file with pnpm vitest — all 23 tests pass, including the updated test for this case.

Added or updated tests

Updated the test "says nothing about a fetch that did not happen" in provider-card-copy.test.ts — it was asserting the old buggy output (full stop missing). It now asserts the full stop is preserved.

QA follow-up

N/A

Demo

This is a text/logic-only fix — there is no UI to screenshot. As evidence, here is the local test run showing all 23 tests passing after the change, including the updated test for this exact bug:
image

Checklist

  • Demo shows the real app running this branch (not a mock-up or recreated UI), or is marked N/A
  • Relevant tests pass locally
  • Relevant linting and formatting pass locally
  • I have signed the CLA, or I will sign it when the bot prompts me

Contributor Resources

@vercel

vercel Bot commented Sep 1, 2026

Copy link
Copy Markdown

@Amanjha2005 is attempting to deploy a commit to the agenta projects Team on Vercel.

A member of the Team first needs to authorize it.

@CLAassistant

CLAassistant commented Sep 1, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@github-actions

github-actions Bot commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

✅ Thanks @Amanjha2005! This PR now meets the contribution requirements and has been reopened. A maintainer will review it soon.

@github-actions github-actions Bot added the incomplete-pr PR is missing required template sections or a demo recording label Sep 1, 2026
@github-actions github-actions Bot closed this Sep 1, 2026
@coderabbitai

coderabbitai Bot commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Team

Run ID: b4e668ca-8728-4668-b3e1-46b0944d15b3

📥 Commits

Reviewing files that changed from the base of the PR and between 33b442f and ac3d27e.

📒 Files selected for processing (2)
  • web/packages/agenta-entities/src/secret/core/cardCopy.ts
  • web/packages/agenta-entities/tests/unit/provider-card-copy.test.ts

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Summary

Summary by CodeRabbit

  • Bug Fixes

    • Credential status messages now preserve their original trailing punctuation when no model count is available.
    • Status messages that include a model count continue to use consistent punctuation.
  • Tests

    • Updated coverage to verify that API error messages retain their final full stop.

Walkthrough

credentialStatusLine preserves the API message's trailing period when modelCount is null. The related unit test expects the updated output.

Changes

Credential status copy

Layer / File(s) Summary
Preserve null-count punctuation
web/packages/agenta-entities/src/secret/core/cardCopy.ts, web/packages/agenta-entities/tests/unit/provider-card-copy.test.ts
The null model-count branch returns the trimmed message with its trailing period. The unit test validates "OpenAI rejected this key (401).".

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to ac3d2

The change preserves the final period in credential status messages when no model count is appended, fixing incorrect sentence formatting without affecting broader behavior. No actionable merge-blocking risk remains after normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: preserving the full stop in credential status lines when no model count is available.
Description check ✅ Passed The description directly explains the punctuation defect, the implementation change, the updated test, and the test result.
Linked Issues check ✅ Passed The PR satisfies the directly addressed requirement in issue #6443 by preserving punctuation when no model list is fetched. The issue explicitly identifies this fix as a complete, useful change that c…
Out of Scope Changes check ✅ Passed The source and test changes are limited to the punctuation fix described in issue #6443. No unrelated changes are present.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
Full details: Linked Issues check

Explanation

The PR satisfies the directly addressed requirement in issue #6443 by preserving punctuation when no model list is fetched. The issue explicitly identifies this fix as a complete, useful change that can ship independently.

Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2 files.

✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot removed the incomplete-pr PR is missing required template sections or a demo recording label Sep 1, 2026
@github-actions github-actions Bot reopened this Sep 1, 2026
@Amanjha2005

Copy link
Copy Markdown
Author

Hi @mmabrouk, this PR is ready for review — all checks pass except the Vercel deploy which needs maintainer authorization. Please take a look when you get a chance!

@mmabrouk

Copy link
Copy Markdown
Member

🤖 The AI agent says: Thank you, @Amanjha2005, for fixing the missing full stop in the credential status line. PR #6472 fixes the same issue (#6443) and also stops the stale model list, so we are keeping that one and closing this PR. You are welcome to contribute again.

@mmabrouk mmabrouk closed this Oct 23, 2026
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.

(bug) The provider drawer lists 34 models for a key that OpenAI just rejected

3 participants