Skip to content

fix: classify subagent tool authentication failures - #632

Open
dschenk wants to merge 2 commits into
LibreChat-AI:mainfrom
gridonic:agent/subagent-mcp-failures
Open

dschenk wants to merge 2 commits into
LibreChat-AI:mainfrom
gridonic:agent/subagent-mcp-failures

Conversation

@dschenk

@dschenk dschenk commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

A lazy subagent whose required tools need authentication currently reports "Unable to initialize the selected subagent", even when its host knows that sign-in is required. Add two allowlisted host classifications: authentication_required and tools_unavailable. The former tells the parent to wait for sign-in before retrying; unknown classifications still receive the generic fallback.

This is the SDK part of a LibreChat integration fix. It does not infer causes from provider error text or change authentication, retry, or execution policy. The existing failure hook selects a category; all outward messages remain fixed strings.

Testing

  • Negative control: both new classification cases fail on unchanged upstream (2 failed, 18 passed).
  • Diagnostics and lazy-subagent suites: 72 passed.
  • npx tsc --noEmit: passed.
  • Touched-file ESLint and formatting: passed.
  • The parameterized regressions also verify that error messages, names, stacks and token-like strings cannot enter the public diagnostic or retained resolution error.

No live provider or OAuth server was used. No UI changes in this library.

Host integration: LibreChat-AI/LibreChat#17302 (draft pending an SDK release). Reconnect UI: LibreChat-AI/LibreChat#17300. Tracking: LibreChat-AI/LibreChat#17301.

@dschenk

dschenk commented Oct 21, 2026

Copy link
Copy Markdown
Contributor Author

@codex review the current head e570ae7, especially allowlisted diagnostics and preservation of the raw-error disclosure boundary. The LibreChat host integration will be linked separately.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-21T09:19:26.712435Z 30a6657 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.

@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: e570ae75c6

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

Comment thread src/tools/subagent/diagnostics.ts
@dschenk

dschenk commented Oct 21, 2026

Copy link
Copy Markdown
Contributor Author

@codex review the current head 30a6657. The documentation finding is addressed; focused diagnostics/lazy-executor tests (72) and TypeScript pass.

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 30a66572f1

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

1 participant