Skip to content

🪸 feat: Expose Subagent Graphs as a Native Tool - #16764

Open
lia-by-librechat[bot] wants to merge 24 commits into
devfrom
lia/subagent-graph-tool
Open

lia-by-librechat[bot] wants to merge 24 commits into
devfrom
lia/subagent-graph-tool

Conversation

@lia-by-librechat

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

Copy link
Copy Markdown
Contributor

Summary

Expose the agents SDK's saved-team graph subagents as a third native tool, Subagent Graphs, beside Subagents and Handoffs.

Its settings dialog edits team names and tool identifiers, members, direct DAG connections, entry/result agents, and transition instructions. The shared graph schema validates topology before applying the draft. Each team is dynamically selected by the parent's existing spawn tool and executes in an isolated child graph.

The new subagent_graphs capability and subagents.graphsEnabled flag control graph teams independently. Disabling ordinary subagents does not disable explicitly enabled teams. Removing the graph tool preserves definitions without touching ordinary subagents or handoffs. Editing or removing a non-final saved team preserves the stored graph enablement choice, including omitted legacy flags. Removing the final team explicitly disables graphs. The new capability is opt-in by default.

How it works

Native tool → validated saved team → owner-scoped member initialization
  → SDK kind: graph → one designated result returns to the parent

The existing graph executor, member access checks, loading budgets, and persistence remain authoritative. Tool-card selection, composer reachability, workspace inheritance, file-sharing activation, input snapshots, and descendant file authorization apply the same deployment capability projection. Disabled teams cannot block Send or impose shared-file limits on ordinary chat. Runtime projection applies the capability choices without mutating stored settings. Legacy graph records retain their previous subagents gate until an explicit graph choice is saved.

Type of change

  • Feature
  • Tests / tooling / CI

Testing

Head: 88a4190e0f3daaad71f6a865efd40d1b93c05a45. Base branch: dev at a7e4de8c82caa9512885f12c2df6fb2dcfdd33a9; merge-base: 94ae8a419839f8c99f5cfc15a650804ced8163c2. Normal commit/push; no merge, dependency/version change, auth patch, or force-push.

  • 331 focused tests passed across 5 suites: real Mongo runtime/resume admission parity, inheritance, discovery, snapshot/preflight (140), and resume-controller before-claim behavior (191).
  • Regressions accept 49/50 actual members despite missing/revoked ordinary targets, accept six real descendants after 60 unique read attempts, preserve shared/cyclic upgrades and deduplication, reject the 51st admitted member, and fail closed on required graph members in either traversal order.
  • The read bound uses the existing per-agent unique-target ceiling. Each admitted/root agent expands once; failed reads remain cached. No new configurable or hard-coded limit was added; C17's root-read budget is unchanged.
  • Current API/package builds, import sorting, and all 67 PR-file static checks passed. API npx tsc --noEmit reports only the two unchanged installed-MCP redirectPolicy diagnostics. Unchanged client types were not rerun.
  • Exact-head CI completed: 48 passed, 2 skipped (bombadil and Codegraph select), no failures. Verified 2026-10-23 15:42:18 UTC. Both TypeScript checks, Lighthouse, API shards and browser jobs passed.
  • Previous head 08529accf: API shard 1/4 failed only the unchanged bcrypt event-loop assertion (<50 ms, measured 50 ms), with 4,885 passing tests and one failure. The auth directory is unchanged from the frozen merge-base; the test blob is identical. Its threshold was not changed, and that old head was not rerun. Previous-head Lighthouse passed; it does not cover this head.
  • Full local suites, live providers, browser execution, production client build, and local Lighthouse were not rerun on this head. The parent's earlier local Lighthouse attempt failed starting Mongo after building the old-head client; no local performance verdict.

Finding Dispositions

C1–C18 and R1–R8 remain fixed. No findings rejected.

  • C13/P2: endpoint capabilities now reach the ordinary editor's effective graph count. A 24-case real-dialog matrix covers ordinary-only, graph-only, both/revoked capabilities, and explicit/legacy enablement without changing stored flags.
  • C14/P2: final-team removal disables graphs. A 24-case editor/runtime-projection matrix covers final/non-final removal, all graph flag states, ordinary enablement, and sharing while preserving handoffs and unrelated settings.
  • C15/P2: resume excludes deduplicated roots from the member budget. Regressions accept 50 unique members with additional roots/shared members, reject 51, and fail closed on missing, revoked, unavailable, or policy-blocked boundary members. Inert policy does not load members.

All three Codex threads have fixing-commit and regression replies and are resolved. Production fixes: 4bacfb124; typed preflight fixture: 7b4c9ef81.

  • C16/P2: fixed in 25ee0edbc907867e39a7ce487f1f0b370e4eeee6. Top-level handoffs are discovered before isolated children expand. Saved child handoffs/chains no longer promote workspace roots; nested ordinary spawns remain reachable. Composer tests verify parent-owned selection, offline unused defaults, independent root upgrades, and both roster orders. Mongo-backed server tests verify the same machine assignment.

  • C17/P2: fixed in 25ee0edbc907867e39a7ce487f1f0b370e4eeee6. Resume uses runtime edge discovery/reachability for roots before counting isolated members. Root and member reads have separate bounded budgets, shared loads/access checks are reused, and roots reused as graph members do not spend member slots. Tests cover chains/cycles/diamonds, additional/shared/current roots, role upgrades in both orders, exact 50/overflow, unavailable members, capability revocation, and before-claim failure. A direct runtime-to-resume parity test admits the handoff plus all 50 members.

  • C18/P2: fixed in 08529accf3117a613ce02520fe915947f76455c4. Reaching the member cap blocks new loads, not cached role upgrades. The existing depth ceiling and bounded MIN_LOAD_BATCH behavior remain unchanged. Real Mongo/routing regressions reproduce the prior failure at 50 and verify the final route, shared/cyclic upgrades, exact load deduplication, late-batch upgrades, and bounded 51st-agent behavior.

  • C19/P2: fixed in 88a4190e0f3daaad71f6a865efd40d1b93c05a45. Only successfully loaded, authorized ordinary targets consume admission slots. Missing/revoked ordinary targets are skipped; required graph targets still fail closed, including cached misses. Real Mongo parity and controller tests cover near/exact admission limits, overflow, bounded attempts, shared nodes/cycles, traversal order, and rejection before admission/claim/init/checkpoint cleanup.

Screenshots / recordings

Running-app captures succeeded in light and dark mode for the native tool, saved teams, and graph editor. Subagent Graphs is new, so it has no previous settings dialog. Screenshot upload is blocked by GitHub’s unsupported authentication type error.

Risk / compatibility

Graph execution with human-in-the-loop remains unsupported by the deployed SDK contract. The dialog explains this limitation. Production approval protection is not bypassed; the dedicated browser execution profile disables approval only in its test deployment.

Legacy graph settings remain compatible under their old capability until changed. Graph-only flags require the new host version and capability. Rollback should disable the new capability rather than assuming an older host understands graph-only enablement.

Checklist

  • I reviewed my own changes
  • Relevant tests have been added or updated
  • Existing relevant tests pass
  • Required dependency changes have been merged/published
  • Required documentation PR: N/A

Review

Independent review of 88a4190e0f3daaad71f6a865efd40d1b93c05a45 completed with no findings. The reviewer read the complete 67-file diff and traced capability projection, editor state, discovery, workspace/file routing, persistence and preflight. Reviewer runtime tests/builds were not run. C1–C19 and R1–R8 remain addressed; none rejected. No newer Codex review is claimed for this head.

@lia-by-librechat

Copy link
Copy Markdown
Contributor Author

Head 45138f9: adds a third native graph tool, validated DAG editor, independent graph capability/enable flag, and runtime projection preserving legacy teams. Real SDK graph execution passes with approval disabled; production HITL is never bypassed. Focused checks passed; independent review and additional host checks follow.

@lia-by-librechat

Copy link
Copy Markdown
Contributor Author

Head 874807d: fixes both P2 findings. Public execution metadata includes graphsEnabled; ordinary Subagents toggles retain legacy capability semantics. Regenerated OpenAPI and verified graph-only Project initialization. Focused regressions and OpenAPI consistency pass; final static checks and a fresh independent review follow this head.

@lia-by-librechat

Copy link
Copy Markdown
Contributor Author

Head 32a75ed: fixes R3/P2 by applying deployment capabilities to every composer reachability and workspace-inheritance path. The subsystem sweep covered flag writers, public metadata, server chat/remote/schedule projection, and client submission. Disabled graph members no longer block Send. Legacy teams retain their original gate. All 135 composer tests, client TypeScript, and scoped static checks pass. R1 and R2 remain fixed in 874807d. Fresh independent review follows this head.

@lia-by-librechat

Copy link
Copy Markdown
Contributor Author

Head 9fb56bf: fixes R4/P2 and R5/P2. Untouched legacy teams require the ordinary subagents capability; explicit teams require subagent_graphs. The same shared predicates gate initialized roots and every stored descendant in server workspace inheritance. A 45-case capability matrix and nested database-backed routing regressions pass, with 50 shared tests and 477 API tests total. Provider/API/client typechecks and scoped static checks pass. Fresh independent review follows.

@lia-by-librechat

Copy link
Copy Markdown
Contributor Author

Head 8fb8558: fixes R6/P2. Applying an existing graph draft preserves the current enablement choice, including a disable made while the draft is open; creating a new team remains an explicit add operation. The write helper no longer has an implicit activation default. Added multi-team edit, draft-toggle, removal, and persisted disabled-edit regressions. Focused editor tests, client typecheck, and scoped static checks pass. Full focused/browser checks and independent review follow this head.

@lia-by-librechat

Copy link
Copy Markdown
Contributor Author

Head 7abc167: fixes R7/P2. File-sharing snapshots, activation, and descendant/recipient authorization now apply required request-scoped capabilities to saved agent contexts. Disabled graph sharing cannot impose manifest limits on ordinary attachments. Coverage includes the capability/flag matrix, raw production-host settings, nested resumed recipients, publication denial/retry, and enabled-graph compatibility. All 120 focused file tests, API TypeScript, package builds, and scoped static checks pass. Fresh independent review follows.

@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Lighthouse CI failed. The last 80 log lines contain the measured budgets and assertion failures.


[WebServer] 2026-10-05 04:14:42 info: [StreamServices] Created in-memory stream services

[WebServer] 2026-10-05 04:14:42 info: [GenerationJobManager] Configured with in-memory stores

[WebServer] 2026-10-05 04:14:42 info: HTTP server timeout configuration

[WebServer] 2026-10-05 04:14:42 info: Server listening at http://localhost:3080

[WebServer] 2026-10-05 04:14:42 info: [MCPServersRegistry] Creating new instance

[WebServer] 2026-10-05 04:14:42 info: OAuth reconnect manager initialized successfully.

[WebServer] 2026-10-05 04:14:42 info: Created collection: projects

🤖: global setup has been started
🤖: using baseURL http://localhost:3080
🤖: using E2E user: testuser@example.com
🤖: 🗝  authenticating user: testuser@example.com
🤖: ✔️  localStorage: set Nav as Visible /home/runner/work/LibreChat/LibreChat/e2e/storageState.json
[WebServer] 2026-10-05 04:14:44 info: [agent-triggers] durable delivery engine started

[WebServer] 2026-10-05 04:14:45 info: [schedules] engine started

[WebServer] 2026-10-05 04:14:45 info: Server readiness checks passing.

🤖: ✔️  user successfully registered
[WebServer] 2026-10-05 04:14:48 info: [Login] [Login successful] [Username: testuser@example.com] [Request-IP: ::1] {"requestId":"a72ac083-68c9-453d-827d-8cc5629eef5c","request_id":"a72ac083-68c9-453d-827d-8cc5629eef5c","request_method":"POST","request_path":"/api/auth"}

🤖: ✔️  user successfully authenticated
🤖: ✔️  authentication state successfully saved in /home/runner/work/LibreChat/LibreChat/e2e/storageState.json
🤖: global setup has been finished

Running 1 test using 1 worker

[1/1] [chrome] › e2e/lighthouse/load.spec.ts:10:5 › serial database latency stays within web-vitals budgets
[chrome] › e2e/lighthouse/load.spec.ts:10:5 › serial database latency stays within web-vitals budgets
Lighthouse run 1/3 wrote /home/runner/work/LibreChat/LibreChat/.lighthouse/lhr-1.report.json

Lighthouse run 2/3 attempt 1 did not complete, retrying: Command failed: /opt/hostedtoolcache/node/24.16.0/x64/bin/node /home/runner/work/LibreChat/LibreChat/node_modules/lighthouse/cli/index.js http://localhost:3080/c/16390000-0000-4000-8000-000000000001 --quiet --preset=desktop --throttling-method=provided --only-categories=performance --chrome-flags=--headless=new --extra-headers={"Cookie":"token_provider=librechat; refreshToken=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjZhYzMyNDM0ZDlkNTY5MDQ0ODkzODcyYiIsInNlc3Npb25JZCI6IjZhYzMyNDNiZDlkNTY5MDQ0ODkzODc5ZiIsImlzc3VlZEF0TXMiOjE3OTExNzM2OTE1NzgsImlhdCI6MTc5MTE3MzY5MSwiZXhwIjoxNzkxMTc3MjkxfQ.v3ATg73xi6McI8rO47Yv2FrVI5HPXYNr0xh9UzpYWBQ"} --output=json --output=html --output-path=/home/runner/work/LibreChat/LibreChat/.lighthouse/lhr-2

  1) [chrome] › e2e/lighthouse/load.spec.ts:10:5 › serial database latency stays within web-vitals budgets 

    Error: Command failed: /opt/hostedtoolcache/node/24.16.0/x64/bin/node /home/runner/work/LibreChat/LibreChat/node_modules/lighthouse/cli/index.js http://localhost:3080/c/16390000-0000-4000-8000-000000000001 --quiet --preset=desktop --throttling-method=provided --only-categories=performance --chrome-flags=--headless=new --extra-headers={"Cookie":"token_provider=librechat; refreshToken=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjZhYzMyNDM0ZDlkNTY5MDQ0ODkzODcyYiIsInNlc3Npb25JZCI6IjZhYzMyNDNiZDlkNTY5MDQ0ODkzODc5ZiIsImlzc3VlZEF0TXMiOjE3OTExNzM2OTE1NzgsImlhdCI6MTc5MTE3MzY5MSwiZXhwIjoxNzkxMTc3MjkxfQ.v3ATg73xi6McI8rO47Yv2FrVI5HPXYNr0xh9UzpYWBQ"} --output=json --output=html --output-path=/home/runner/work/LibreChat/LibreChat/.lighthouse/lhr-2
    Runtime error encountered: Something went wrong with recording the trace over your page load. Please run Lighthouse again. (NO_NAVSTART)


    attachment #1: screenshot (image/png) ──────────────────────────────────────────────────────────
    e2e/lighthouse/.test-results/load-serial-database-latency-stays-within-web-vitals-budgets-chrome/test-failed-1.png
    ────────────────────────────────────────────────────────────────────────────────────────────────

    Error Context: e2e/lighthouse/.test-results/load-serial-database-latency-stays-within-web-vitals-budgets-chrome/error-context.md

    attachment #3: trace (application/zip) ─────────────────────────────────────────────────────────
    e2e/lighthouse/.test-results/load-serial-database-latency-stays-within-web-vitals-budgets-chrome/trace.zip
    Usage:

        npx playwright show-trace e2e/lighthouse/.test-results/load-serial-database-latency-stays-within-web-vitals-budgets-chrome/trace.zip

    ────────────────────────────────────────────────────────────────────────────────────────────────


🤖: global teardown has been started
2026-10-05 04:16:23 �[32minfo�[39m: �[32mMongo Connection options�[39m
2026-10-05 04:16:23 �[32minfo�[39m: �[32m{�[39m
�[32m  "bufferCommands": false�[39m
�[32m}�[39m
🤖:  ✅  Connected to Database
🤖:  ✅  Found user in Database
🤖:  ✅  Deleted 1 convos & 2 messages
🤖:  ✅  Deleted user from Database
🤖: global teardown has been started
2026-10-05 04:16:24 �[32minfo�[39m: �[32mMongo Connection options�[39m
2026-10-05 04:16:24 �[32minfo�[39m: �[32m{�[39m
�[32m  "bufferCommands": false�[39m
�[32m}�[39m
🤖:  ✅  Connected to Database
🤖:  ⚠️  User not found in Database
  1 failed
    [chrome] › e2e/lighthouse/load.spec.ts:10:5 › serial database latency stays within web-vitals budgets 

Open the full run

@lia-by-librechat

Copy link
Copy Markdown
Contributor Author

CI at 7abc167: Lighthouse produced report 1, then failed twice to record report 2 with NO_NAVSTART before a performance-budget verdict. The installed CLI refused the job rerun. No source or budgets changed to mask this recording failure. File-sharing, host, remote-controller, client, OpenAPI, and scoped static regressions pass locally; independent review is in progress.

@lia-by-librechat

Copy link
Copy Markdown
Contributor Author

Head 53f0f9e: fixes R8/P2. Strict Management API responses now preserve graphsEnabled and shareFiles, matching the accepted persisted subagent contract. Regenerated Agent response OpenAPI. Legacy/explicit flags and file-sharing choices round-trip through create, update, GET, and list without relaxing unknown-field rejection. All 82 focused Management API tests, API TypeScript, OpenAPI consistency, package builds, and scoped static checks pass. Fresh independent review follows.

@lia-by-librechat

Copy link
Copy Markdown
Contributor Author

Independent review complete for 53f0f9e: no findings. All eight prior P2 findings are fixed, with none rejected or outstanding. The full diff was reviewed across capabilities, saved settings, member access, budgets, workspace routing, file authorization, and Management API contracts. Local verification includes 370 client tests and 330 Management/file-boundary tests. SDK graph HITL support is not included; the existing guard remains unchanged.

@lia-by-librechat

Copy link
Copy Markdown
Contributor Author

Head d64bb55: merged dev at 114394c, preserving per-call machine placement, settlement, and tool context attachment. Graph sharing capability checks now apply to the new machine-routing admission helper as well as snapshots and file-session authorization. Added coverage to the existing sharing capability matrix. Focused checks and independent review follow this head. SDK graph HITL support remains a separate planned change.

@lia-by-librechat

Copy link
Copy Markdown
Contributor Author

Independent review complete for d64bb55: no findings. Current dev machine-routing placement, settlement, context attachment, and routed-member loading are preserved. All eight prior P2 findings remain fixed; none rejected or outstanding. Local checks passed: 392 API graph/routing tests, 39 host initialization tests, 282 client native/composer tests, all changed-workspace typechecks, package builds, OpenAPI consistency, and PR static/English-key gates. SDK graph HITL remains planning-only.

@danny-avila

Copy link
Copy Markdown
Collaborator

@codex review the latest head, final review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 5, 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-24T06:38:08.214935Z 88a4190 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: d64bb55ea9

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

const { control, getValues, setValue } = useFormContext<AgentForm>();
const subagents = useWatch({ control, name: 'subagents' });
const graphs = subagents?.graphs ?? [];
const enabled = isSubagentGraphsEnabled(subagents);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Honor capability gates when preserving legacy graph state

When a deployment enables only subagent_graphs, a legacy record with enabled: true and no graphsEnabled is intentionally disabled by resolveSubagents(config, capabilities), but this capability-less call reports it as enabled. Consequently, opening the graph editor shows the switch on, and saving an unrelated edit passes this enabled value to write, persists graphsEnabled: true, and silently activates a previously dormant team. Pass agentsConfig.capabilities here so edits preserve the effective mixed-version state rather than changing authorization.

AGENTS.md reference: AGENTS.md:L45-L52

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 9958b45. The switch now uses deployment capabilities. Unrelated edits and removal preserve the stored graphsEnabled choice, including omitted legacy flags. New teams and explicit toggles alone change activation. Mixed-capability regressions pass.

Comment thread packages/data-provider/src/config.ts Outdated
AgentCapabilities.web_search,
AgentCapabilities.artifacts,
AgentCapabilities.subagents,
AgentCapabilities.subagent_graphs,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Keep the graph capability opt-in by default

For installations that omit endpoints.agents.capabilities, adding subagent_graphs to defaultAgentCapabilities automatically exposes and authorizes this new orchestration feature after upgrade. That changes the default behavior rather than merely making the new lever configurable, and can make multi-agent graph execution available without an administrator choosing it. Leave this capability out of the default list and document it alongside the other opt-in capabilities.

AGENTS.md reference: AGENTS.md:L90-L92

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 9958b45. Removed subagent_graphs from defaultAgentCapabilities. The existing config enum still supports explicit opt-in. The default-capability regression passes. No documentation files changed.

};
const save = () => {
if (!draft) return;
const parsed = graphSubagentSchema.safeParse(draft.graph);

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 Validate the aggregate graph member limit before applying drafts

When several individually valid teams collectively reference more than MAX_SUBAGENT_GRAPH_NODES (50) unique agents, this per-team parse succeeds and each draft is applied to the form, even though agentSubagentsSchema rejects the combined configuration when the agent is finally saved. The UI permits up to 10 teams with 32 members each, so this is reachable without bypassing any controls and leaves users unable to save after completing the editor flow. Validate the prospective full subagents collection, including ordinary agent_ids, before calling write.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 9958b45. Prospective drafts now count unique targets across ordinary agent_ids and every team before writing the form. Client and server share the same counter; tests cover the boundary and deduplication.

</CountPill>
}
>
{agentsConfig?.toolApproval?.enabled === true && (

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 Warn when attached code implicitly enables approval wiring

For agents using an attached code environment, resolveToolApprovalPolicy synthesizes { enabled: true, mode: 'bypass' } when the endpoint omits toolApproval, and the resumable chat path therefore still passes humanInTheLoop to the SDK. The pinned SDK rejects graph-team execution with that wiring, but this raw-config check hides the warning because agentsConfig.toolApproval?.enabled is undefined. Detect the effective approval state (including attached-code/BYOM wiring) so these users are told that their configured graph cannot execute.

AGENTS.md reference: AGENTS.md:L49-L52

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 9958b45. The warning includes implicit attached-code approval wiring from the current form and graph members, while honoring the explicit endpoint enabled:false override. Tests cover the implicit baseline, enabled/disabled endpoint policies, and managed environments.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The serialized endpoint boundary is now also fixed in e63ec7e. The implicit warning uses public statefulCodeSessions.approvalsEnabled, not the serialized enabled:false default. Actual serializer-policy tests and public-response component tests pass; the exact-head independent review returned no findings.

@lia-by-librechat

Copy link
Copy Markdown
Contributor Author

Head 9958b45: fixes Codex capability-preservation, opt-in-default, aggregate-member-limit, and implicit attached-approval warning findings. Shared graph tests (52), editor/native-tool tests (30), and scoped static gates passed. Remaining workspace checks, Lighthouse preparation, CI, and fresh exact-head independent review follow.

@lia-by-librechat

Copy link
Copy Markdown
Contributor Author

Head 2b87550: completes nullable code-environment handling and fully typed approval-warning fixtures. Codex’s four findings remain fixed. API, client, and data-provider typechecks pass; focused shared/API/editor/native-tool tests pass (134 total). Package/frontend builds and touched-file static gates pass. Local Lighthouse startup was adapted for read-only /tmp and Chromium, but the audit exceeded the worker’s execution limit. Fresh exact-head independent review and CI follow.

@lia-by-librechat

Copy link
Copy Markdown
Contributor Author

Independent review completed at afdadad: no findings. Current dev e081b56 is included. C1–C7 and earlier findings remain resolved; none rejected. Local merge verification: 494 focused tests, data-provider/data-schemas types and builds, scoped formatting/import/JSON gates passed. Exact-head CI: 41 success, 2 skipped, 6 in_progress. CI typechecks, static checks, package builds, and Lighthouse passed. Local API types hit unchanged MCP dependency drift; further local builds/client checks stopped below the disk floor. Full local suite, browser execution, and local Lighthouse were not rerun.

@lia-by-librechat

lia-by-librechat Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor Author

Updated head: 14d77d0b99ead01a97733b45e29344ec8fb30114.

Normal merge from dev at 8c51a3f9f8da82cd3ab8e43ef237c4b1479425ef. Preserves graph capability gates and legacy embedding hooks, with graph-only embedding-reuse coverage. No SDK dependency change or production approval bypass.

1,763 focused tests passed across 17 suites. Shared/client typechecks, five package builds and scoped static checks passed. Local API typechecking retains two unchanged MCP transport dependency-drift errors. Exact-head CI backend/client TypeScript, package builds, static checks and Lighthouse passed. Independent review of this exact head is parent-managed.

@lia-by-librechat

Copy link
Copy Markdown
Contributor Author

Independent review completed at 14d77d0: no findings. Merge includes latestdev8c51a3f9f8da82cd3ab8e43ef237c4b1479425ef. All1763 focused merge tests, client/data-provider/data-schemas types, package builds and scoped static gates passed. API local types remain blocked by unchanged installed dependency drift; CI types and Lighthouse passed. Current CI: 38 success, 2 skipped, 9 in_progress. No force-push, dependency upgrade to SDK599, or PR merge.

@danny-avila

Copy link
Copy Markdown
Collaborator

@codex review the latest head, final review

@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: 14d77d0b99

ℹ️ 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 +19 to +22
if (tool === 'subagent_graphs') {
return agentsConfig?.capabilities.includes(AgentCapabilities.subagent_graphs) ? (
<Graphs currentAgentId={currentAgentId} />
) : null;

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 Expose file sharing for graph-only teams

When an endpoint enables subagent_graphs without subagents, this branch renders only Graphs, while the shareFiles control remains exclusively inside AgentSubagents and is hidden unless ordinary subagents are enabled. The backend explicitly supports graph-only sharing through isRunFileSharingRequested, so builder users cannot enable or disable that supported behavior without also activating the unrelated ordinary-subagent tool; expose the sharing toggle in the graph editor or a common orchestration panel when endpoint file sharing is enabled.

AGENTS.md reference: AGENTS.md:L50-L53

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 564702c. Graphs now exposes the shared file toggle whenever endpoint file sharing is enabled. The component regression toggles it both ways under the graph-only capability and asserts ordinary enablement, graph definitions, and handoffs remain unchanged.

Comment thread librechat.example.yaml Outdated
# # web_search controls only LibreChat's external pipeline, not provider-native search.
# # Both require WEB_SEARCH.USE, seeded by interface.webSearch. See UPGRADING.md.
# capabilities: ["deferred_tools", "execute_code", "file_search", "web_search", "artifacts", "subagents", "actions", "context", "skills", "memory", "ask_user_question", "tools", "ocr"]
# capabilities: ["deferred_tools", "execute_code", "file_search", "web_search", "artifacts", "subagents", "subagent_graphs", "actions", "context", "skills", "memory", "ask_user_question", "tools", "ocr"]

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 List subagent graphs as opt-in in the example config

The current head correctly leaves subagent_graphs out of defaultAgentCapabilities, but this line adds it to the list documented as the default and omits it from the opt-in list immediately below. Administrators who copy the example will therefore silently enable graph execution, while those who omit capabilities get different behavior; move subagent_graphs to the opt-in list so the example preserves the actual default.

AGENTS.md reference: AGENTS.md:L91-L93

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 564702c. Moved subagent_graphs from the default capabilities example into the explicit opt-in list. Actual defaultAgentCapabilities remains unchanged.

Comment on lines +176 to +180
const capability =
config?.graphsEnabled == null ? AgentCapabilities.subagents : AgentCapabilities.subagent_graphs;
return (
(config?.graphsEnabled ?? config?.enabled === true) &&
(capabilities == null || capabilities.includes(capability))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Include graph members in resume preflight traversal

When a graph member is edited or loses VIEW access while a run is paused, this resolver still makes the team runnable, but resume preflight only recognizes AgentCapabilities.subagents and getReferencedAgentIds walks only subagents.agent_ids (hitl/protection.ts:784-792 and hitl/inspection.ts:135-139). The controller can therefore claim the pending resume without validating that member, after which initialization or the later runtime filter rejects the changed graph and turns a pre-claim policy rejection into a consumed, failed restored session. Resolve the effective subagent configuration during preflight and traverse every active graphs[].agent_ids entry as well.

AGENTS.md reference: AGENTS.md:L50-L53

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 564702c. Resume content preflight now projects ordinary and graph capability gates, includes active graph members, and fails closed if an active member is missing or loses VIEW. Real preflight and controller-boundary tests cover edited members, missing/revoked members, legacy gates, and disabled graphs. The controller tests assert rejection before concurrency admission, approval claim, initialization, or checkpoint deletion. This remains scoped to enabled resume content policy.

]);
const subagents = agent.subagents?.enabled === true ? agent.subagents : undefined;
const subagents = resolveSubagents(agent.subagents, capabilities);
const graphIds = subagents?.graphs?.flatMap((graph) => graph.agent_ids);

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 Treat graph members as terminal in composer traversal

When a graph member itself has ordinary subagents or handoff edges, adding it here causes later BFS iterations to traverse those descendants, so useCodeWorkspace and approval-mode discovery treat their attached environments as runnable. Runtime graph members deliberately receive no nested subagentConfigs (run-summarization.test.ts:3123-3171), so those descendants cannot execute; for example, an offline attached-code grandchild can nevertheless mark the composer unavailable and block Send for a valid team. Stop traversal at graph members unless the same agent is separately reachable as an ordinary subagent or handoff root.

AGENTS.md reference: AGENTS.md:L50-L52

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 564702c. Composer discovery, approval warnings, and workspace inheritance now share terminal graph-member traversal with ordinary/handoff path upgrades. Backend workspace planning also stops at graph members. Regressions cover both shared-path orders, cycles/diamonds, missing terminal descendants, offline descendants not blocking Send, and no duplicate member loads.

@lia-by-librechat

lia-by-librechat Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor Author

Head: 564702c. Base and merge-base: 6189220 (dev). Merged dev normally. Addresses C8–C11: graph-only file sharing, opt-in example configuration, capability-projected graph-member content preflight before the resume claim, and terminal graph traversal across composer discovery, approval warnings, and workspace inheritance. Passed so far: 181 resume-controller tests, 39 resume-policy tests, 188 frontend tests, and 20 backend inheritance tests. Remaining bounded checks are in progress.

@lia-by-librechat

Copy link
Copy Markdown
Contributor Author

Head 564702c: all four new Codex findings are fixed and replied to; conflicts are resolved. Local1,522 focused tests, client/shared types, builds and static gates passed. CI: 37 success, 10 in_progress, 2 skipped. Independent review is blocked before source inspection by503COMMAND_UNAVAILABLE, not clean. Local API types retain dependency-drift errors; current-head CI types and Lighthouse pass. No PR merge or SDK599 dependency upgrade.

@danny-avila

Copy link
Copy Markdown
Collaborator

@codex review the latest head, final review

@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: 564702c212

ℹ️ 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 +57 to +58
case 'subagent_graphs':
return isSubagentGraphsEnabled(form.subagents) && (form.subagents?.graphs?.length ?? 0) > 0;

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 Gate graph card selection with endpoint capabilities

When a deployment enables only subagent_graphs, a legacy agent with enabled: true, stored graphs, and no graphsEnabled is correctly disabled at runtime because legacy teams still require the subagents capability. This capability-less selection check nevertheless lists the graph tool as installed and makes the marketplace offer removal rather than configuration; users must remove the supposedly active tool before they can explicitly enable it. Pass the deployment capabilities through the selection pipeline so the card reflects the same effective state as Graphs and the runtime.

AGENTS.md reference: AGENTS.md:L50-L53

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 6deb4c9. The shared selection pipeline now receives endpoint capabilities and calls the same graph gate as runtime projection. Tests cover legacy versus explicit graph flags and graph-only deployments: inactive legacy cards open configuration, while explicitly enabled cards remain removable. All 67 selector/marketplace tests and client TypeScript passed.

@lia-by-librechat

Copy link
Copy Markdown
Contributor Author

Head: 6deb4c9b0b28bf49353e8f3dc4b18294b6fe304d.

C12/P2 graph-card capability selection is fixed with regression coverage. Includes a normal merge of dev at 94ae8a419839f8c99f5cfc15a650804ced8163c2, preserving both host-test imports. GitHub confirms the PR is mergeable.

Graph-card tests: 67 passed. Other client graph regressions: 235 passed. Client/data-provider/data-schemas TypeScript and package builds passed. API types, merged backend checks and static gates are finishing; exact-head CI is running.

The completed Codex review covered 564702c21205bc3b99c362dc0cc0996a83383a8b, not this head. Independent review of this head is unavailable from this lane because no delegation tool is exposed.

@lia-by-librechat

Copy link
Copy Markdown
Contributor Author

Independent review completed at 6deb4c9: no findings. C12/P2 graph-card capability selection is fixed and replied to; earlier fixes remain addressed, none rejected. Local905 focused tests, client/shared types, builds and scoped static checks pass. CI: 42 success, 2 skipped, 5 in_progress. Reviewer source-only; local API types retain unchanged MCP drift, local Lighthouse had no performance verdict. No merge or SDK599 dependency upgrade.

@danny-avila

Copy link
Copy Markdown
Collaborator

@codex review the latest head, final review

@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: 6deb4c9b0b

ℹ️ 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 client/src/components/SidePanel/Agents/Advanced/AgentSubagents.tsx Outdated
Comment thread client/src/components/SidePanel/Agents/Advanced/Graphs.tsx Outdated
Comment thread packages/api/src/agents/hitl/inspection.ts Outdated
@lia-by-librechat

lia-by-librechat Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor Author

Head: 7b4c9ef8128023abf1d6ee77b5dc0fbf6a55f851. Merge-base: 94ae8a419839f8c99f5cfc15a650804ced8163c2.

C13–C15 fixed; C1–C12/R1–R8 remain fixed. Capability-aware empty warning, final-team deactivation, and root-excluded resume budget now have regressions. All three threads have commit/evidence replies and are resolved.

  • Local: 942 focused tests / 16 suites, client types, package/API builds, scoped import order and PR static checks passed.
  • API types: only the two unchanged local MCP redirectPolicy diagnostics. The first pushed head's new fixture diagnostic is corrected here without dependency changes.
  • Exact-head CI: 21 success, 2 skipped, 26 in progress, 0 failures (2026-10-23 13:56:40 UTC). Backend and client TypeScript passed.
  • Full local suites, live providers, browser graph execution, and local Lighthouse were not rerun.

Fresh independent review pending for this head. Earlier reviews do not cover it.

@lia-by-librechat

Copy link
Copy Markdown
Contributor Author

Head: 25ee0edbc907867e39a7ce487f1f0b370e4eeee6. Base branch: dev (a7e4de8c82caa9512885f12c2df6fb2dcfdd33a9 currently). Merge-base: 94ae8a419839f8c99f5cfc15a650804ced8163c2.

C16/P2 and C17/P2 independently reproduced and fixed. C1–C15/R1–R8 remain fixed; none rejected.

  • Root discovery now precedes isolated-child expansion in frontend routing and resume inspection. Child handoffs stay inactive; independent handoff roots and ordinary-path upgrades remain effective.
  • Resume root/member read budgets are separate and bounded. Current roots/shared nodes are cached, member access/policy failures remain fail-closed before admission/claim, and exact runtime/preflight 50-member parity is covered.
  • Local: 523 tests/8 suites passed (218 client, 119 API including real Mongo inheritance, 186 controller). Client types, package/API builds, touched import order and static checks passed. API types retain only the two unchanged local MCP diagnostics.
  • Exact-head CI: 7 success, 2 skipped, 24 in_progress. No previous-head CI/review is claimed for this head.
  • Full local suites, live providers, browser execution, production client build, local Lighthouse and PR-wide static rerun were not run in this follow-up. Prior Chrome limitation remains unverified this round.

Fresh independent review pending with the parent. Author lane retained; only this round's scratch/build outputs are being removed.

@lia-by-librechat

Copy link
Copy Markdown
Contributor Author

Head: 08529accf3117a613ce02520fe915947f76455c4. Base: dev (a7e4de8c82caa9512885f12c2df6fb2dcfdd33a9); merge-base: 94ae8a419839f8c99f5cfc15a650804ced8163c2.

C18/P2 independently reproduced and fixed. At the member cap, cached reachability upgrades now finish without new loads. The three-line production change preserves depth and bounded missing-ID batching. C1–C17/R1–R8 remain fixed; none rejected.

  • 310 tests/5 focused suites passed, including real Mongo inheritance/routing parity at 49/50, cycles/deep and late-batch upgrades, load deduplication, and 51st-agent read bounds.
  • API build, import sorting, touched static checks and all 67 PR-file static checks passed. API types retain only the two unchanged MCP diagnostics.
  • Exact-head CI at 2026-10-23 14:59:39 UTC: 16 success, 2 skipped, 31 in_progress. Fresh independent review is pending for this SHA.
  • No new-head local Lighthouse/client-build verdict: the parent's old-head Lighthouse attempt built the client but failed starting Mongo. Full suites, live providers and browser execution were not rerun.

Author lane retained. This round's scratch/build artifacts are being cleaned; parent-owned final-static/final-lighthouse logs remain intact.

@lia-by-librechat

Copy link
Copy Markdown
Contributor Author

Head: 88a4190e0f3daaad71f6a865efd40d1b93c05a45. Base: dev (a7e4de8c82caa9512885f12c2df6fb2dcfdd33a9); merge-base: 94ae8a419839f8c99f5cfc15a650804ced8163c2.

C19/P2 independently reproduced and fixed. Ordinary misses/denials no longer spend admitted-member slots. Read attempts are bounded by existing saved-configuration limits and cached expansion; required graph targets remain fail-closed. C1–C18/R1–R8 remain fixed; none rejected.

  • 331 tests/5 scoped suites passed: 140 API including real Mongo parity, 191 controller before-claim checks. API/package builds, import order and all 67 PR-file static checks passed. API types retain only the two unchanged MCP diagnostics.
  • Exact-head CI at 2026-10-23 15:24:06 UTC: 12 success, 2 skipped, 35 in_progress. Fresh independent review is pending for this SHA.
  • Investigated the prior API shard failure: unchanged bcrypt test measured 50 ms against <50 ms; 4,885 tests passed and one failed. Auth/test sources match the merge-base. No threshold/auth changes or old-head rerun.
  • Full local suites, live providers, browser execution, client types/build and local Lighthouse were not rerun. Old-head Lighthouse results are not claimed for this head.

Author lane retained. Own artifacts are being removed; parent final-static/final-lighthouse logs remain intact.

@lia-by-librechat

Copy link
Copy Markdown
Contributor Author

Independent review completed at 88a4190e0f3daaad71f6a865efd40d1b93c05a45: no findings. C1–C19/R1–R8 are addressed; none rejected. Exact-head CI: 48 passed, 2 skipped, no failures. The previously failing API shard passed. Latest local verification: 331 focused tests/5 suites, package/API builds and PR-wide static checks passed; API types retain two unchanged local MCP diagnostics. Review was source-only. Full local suites, live providers and new-head local Lighthouse were not run. No merge, publication or SDK dependency upgrade.

@danny-avila

Copy link
Copy Markdown
Collaborator

@codex review the latest head, final review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: 88a4190e0f

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

🗺️ Agent Exec Infra codegraph: the taxonomy area this belongs to (classifier, confidence ≥ 0.9) 🗺️ Agent Runtime codegraph: the taxonomy area this belongs to (classifier, confidence ≥ 0.9)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants