Skip to content

Agent fixes#17922

Merged
PClmnt merged 14 commits intomasterfrom
feat/agent-feedback-fixes
Feb 3, 2026
Merged

Agent fixes#17922
PClmnt merged 14 commits intomasterfrom
feat/agent-feedback-fixes

Conversation

@PClmnt
Copy link
Collaborator

@PClmnt PClmnt commented Feb 1, 2026

Description

Fixes a number of issues in our agent code

  • Fixes an issue where some models would fail to call a tool, more accurately, they would start the tool but we would never receive a response from the provider (i.e openrouter / arcee trinity). this would result in a stalled conversation or agent run.
  • Update retry strategy in LiteLLM
  • Add a flag for agent chat preview meaning chat app doesn't need to be enabled.

Summary by cubic

Fixes stalled agent runs by detecting incomplete tool calls and showing clear errors. Adds agent chat preview mode (builder/admin only) and improves reliability with updated LiteLLM retry settings.

  • Bug Fixes

    • Detect incomplete tool-call steps and annotate messages with a user-facing error; prevents “thinking” from hanging.
    • Update LiteLLM retry policy (3 retries, 5s backoff, extra rate-limit retries) to reduce provider stalls.
    • Block saving an agent without a selected model and show an error.
  • New Features

    • Preview agent chats without enabling a chat app (builder/admin only via isPreview; server skips chat app checks); show a success checkmark for completed tool calls.
    • Add tests for tool-call detection and error formatting.

Written for commit 53e6d42. Summary will update on new commits.

@PClmnt PClmnt requested a review from a team as a code owner February 1, 2026 19:54
@PClmnt PClmnt requested review from adrinr and removed request for a team February 1, 2026 19:54
@github-actions github-actions bot added firestorm Data/Infra/Revenue Team size/l labels Feb 1, 2026
Copy link

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

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: efce0da1a0

ℹ️ 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".

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 10 files

Confidence score: 3/5

  • Potential user-impacting risk: preview requests without chatAppId still persist chats in packages/server/src/api/controllers/ai/chatConversations.ts, which could write invalid documents or trigger DB errors
  • Score reflects a single medium-severity issue (6/10) with a concrete runtime impact but limited scope
  • Pay close attention to packages/server/src/api/controllers/ai/chatConversations.ts - ensure chatAppId is required before persisting chats.
Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="packages/server/src/api/controllers/ai/chatConversations.ts">

<violation number="1" location="packages/server/src/api/controllers/ai/chatConversations.ts:180">
P2: Preview requests can omit chatAppId, but the stream still persists chats with that (required) field. This can save invalid chat documents or trigger db errors when chatAppId is undefined. Consider requiring chatAppId when persisting, or skipping persistence for preview chats without a chatAppId.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

@PClmnt
Copy link
Collaborator Author

PClmnt commented Feb 2, 2026

@cubic-dev-ai review again please.

@cubic-dev-ai
Copy link
Contributor

cubic-dev-ai bot commented Feb 2, 2026

@cubic-dev-ai review again please.

@PClmnt I have started the AI code review. It will take a few minutes to complete.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 10 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Copy link
Member

@adrinr adrinr left a comment

Choose a reason for hiding this comment

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

🚀

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 1 file (changes from recent commits).

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="packages/frontend-core/src/components/Chatbox/index.svelte">

<violation number="1">
P2: `isSuccess` is no longer included in the status wrapper condition, so completed tool calls never show the success checkmark (the `isSuccess` branch is unreachable). Include `isSuccess` in the outer condition to render the completion indicator.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

oh, we did need it

Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 1 file (changes from recent commits).

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="packages/frontend-core/src/components/Chatbox/index.svelte">

<violation number="1" location="packages/frontend-core/src/components/Chatbox/index.svelte:78">
P1: This added Svelte template directive is inside a <script> function, which is invalid syntax and breaks the hasToolError predicate. Restore the predicate expression so the component compiles and tool errors are detected.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

@PClmnt PClmnt enabled auto-merge February 3, 2026 13:45
@PClmnt PClmnt merged commit c723dd1 into master Feb 3, 2026
23 checks passed
@PClmnt PClmnt deleted the feat/agent-feedback-fixes branch February 3, 2026 13:56
@github-actions github-actions bot locked and limited conversation to collaborators Feb 3, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

firestorm Data/Infra/Revenue Team size/l

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants