Skip to content

📡 fix: Expose Safe Subagent Startup Diagnostics - #592

Open
lia-by-librechat[bot] wants to merge 1 commit into
mainfrom
lia/subagent-resolution-diagnostics
Open

lia-by-librechat[bot] wants to merge 1 commit into
mainfrom
lia/subagent-resolution-diagnostics

Conversation

@lia-by-librechat

@lia-by-librechat lia-by-librechat Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Subagent identity and lazy-config failures only reached console.warn; detached execution then discarded their classification. Hosts could neither retain the startup cause nor safely explain it to the parent.

  • Add onSubagentResolutionFailure to Run/graph inputs and onResolutionFailure to direct executors. Forward it to detached and nested children.
  • Send safe phase/type/message diagnostics and parent/child correlation IDs. Give hosts the original rejection privately for class/code mapping.
  • Accept only workspace, agent-access, model/provider, configuration-change, or unknown cause codes. Generate parent messages from fixed SDK text.
  • Preserve phase/cause in detached SubagentResolutionError. Keep safe console fallback when the hook is absent or throws.
  • Bump @librechat/agents from 4.0.1 to 4.0.2.

Verification

Passed: 332 subagent regression tests, 203 tracing tests, npx tsc --noEmit, touched-file ESLint/import order, npm run build, npm run check:circular-deps, and CJS/ESM public-export smoke checks.

New tests cover both resolution phases, every cause and unknown fallback, aborts, detached delivery, Run/graph plumbing, malicious error properties, invalid classifications, and secret/stack redaction.

Follow-up

SDK first. LibreChat must map its error classes, log through Winston with conversation context, recognize the typed detached failure, and reproduce quarantined/offline workspace startup. This PR does not establish the cause of the October 2 production failures or publish the package.

@lia-by-librechat

Copy link
Copy Markdown
Contributor Author

Head: 3d99f1dcf6642b186ec00911a779e8702f1b0402.

Adds host-visible startup diagnostics, closed safe cause mapping, typed detached failures, and version 4.0.2. Passed 332 tests across 11 focused suites, TypeScript, touched-file ESLint/import order, package build, and circular-dependency checks. SDK-only; LibreChat logging and live workspace reproduction follow.

@lia-by-librechat

Copy link
Copy Markdown
Contributor Author

Independent review complete for 3d99f1dcf6642b186ec00911a779e8702f1b0402: no findings at any severity. No fixes or rejections required.

Local verification passed: 332 subagent tests, 203 tracing tests, TypeScript, touched-file ESLint/import order, build, circular dependencies, and CJS/ESM exports. CI passed except Anthropic summarization still running.

Not verified here: LibreChat logger integration or live quarantined/offline workspace reproduction. Production root cause remains unconfirmed. Version 4.0.2 is proposed, not published.

@danny-avila

Copy link
Copy Markdown
Collaborator

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 3, 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-03T01:43:33.967036Z 3d99f1d 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: 3d99f1dcf6

ℹ️ 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 on lines +2499 to +2503
childRunId:
execution.identity?.childRunId ?? execution.address.currentChildRunId,
childThreadId:
execution.identity?.childThreadId ??
execution.address.baseChildThreadId,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve resumed child identity in failure diagnostics

When a reconstructed HITL execution fails while prepareCheckpointFork is resolving its identity, execution.identity has not yet been bound, but createChildExecutionIdentity is already operating on resumeExecution.childRunId and branchChildThreadId. These fallbacks instead report a newly derived run ID and the base thread ID, so the new callback gives hosts incorrect correlation IDs precisely for startup failures on resumed children. Use the resume execution and branch address when selecting the unresolved identity.

Useful? React with 👍 / 👎.

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.

2 participants