Skip to content

fix(agents): snapshot shareable MCP catalog metadata as JSON - #199909

Merged
steipete merged 1 commit into
mainfrom
steipete/fix-catalog-mcp-undefined-20261116
Nov 16, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/fix-catalog-mcp-undefined-20261116

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Production regression on Team after deploying ea8bbbb3 (2026-11-15 18:52 PST): subagent runs fail about 2 s after spawn with SyntaxError: Unexpected token 'u', ..."e},"mode":undefined}"... is not valid JSON. Between 18:54 and 18:58 PST there were 12 parse failures and 24 subagent lane errors, and no subagent created after the cutover completed. Main and dashboard turns were unaffected.

Why This Change Was Made

#199804 (3d4bd2a) shares compacted tool catalogs across runs. It keys MCP descriptor metadata with stableStringify, which serializes undefined members as undefined, and then JSON.parses those same key bytes to build the frozen snapshot. An MCP descriptor with an undefined optional field (mode) therefore throws on the shareable-catalog path. The snapshot now goes through JSON.stringify, which drops undefined members. The cache key is unchanged.

User Impact

Subagents spawned in sessions with MCP tools run again. No config, schema, or persisted-state change.

Evidence

  • Regression test src/agents/tool-search-prepared-catalog.test.ts: on the parent it fails with the production SyntaxError: JSON Parse error: Unexpected identifier "undefined", and it passes with the fix.
  • Focused: tool-search-prepared-catalog, tool-search-catalog-reuse, and tool-search.metadata tests pass (5/5); oxfmt clean.
  • Codex autoreview: scoped-clean (0.96).
  • Team evidence: read-only Gateway log aggregates from the reliability session, lane=subagent errors since the cutover.

Shared compacted tool catalogs (#199804) keyed MCP metadata with
stableStringify, which keeps undefined members, then JSON.parse'd those
key bytes for the frozen snapshot. An MCP descriptor with an undefined
optional field (mode) threw SyntaxError, failing subagent runs ~2 s after
spawn on Team ea8bbbb. Snapshot through JSON.stringify instead.
@clawsweeper

clawsweeper Bot commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@steipete
steipete marked this pull request as ready for review November 16, 2026 03:04
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-16T03:06:50.918484Z dde702c Draft marked ready
ℹ️ 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.

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: XS labels Nov 16, 2026
@steipete
steipete merged commit f4d2e45 into main Nov 16, 2026
105 of 109 checks passed
@steipete
steipete deleted the steipete/fix-catalog-mcp-undefined-20261116 branch November 16, 2026 03:05
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 16, 2026
…w#199909)

Shared compacted tool catalogs (openclaw#199804) keyed MCP metadata with stableStringify, which keeps undefined members, then JSON.parsed those key bytes for the frozen snapshot. An MCP descriptor with an undefined optional field (mode) threw SyntaxError and failed subagent runs about 2 s after spawn on Team 9482c95. Snapshot through JSON.stringify instead; the cache key is unchanged.

Regression test fails on the parent with the production SyntaxError and passes with the fix. Focused tool-search tests 5/5, Codex autoreview scoped-clean. Admin-merged at the pinned head with no failed checks (15 pending) to restore subagents on Team.
Patrick-Erichsen added a commit that referenced this pull request Nov 16, 2026
…change (#199944)

* fix(agents): core lint fails on the MCP catalog JSON snapshot

#199909 snapshots MCP catalog metadata through JSON on purpose, because the
round trip drops undefined members that structuredClone would keep. The
unicorn/prefer-structured-clone rule rejects that line, so check-lint-core-2
fails on main and on every pull request whose lint lanes include src/agents.
Record the reason with the repository's usual suppression.

* test(scripts): allow the MCP catalog JSON snapshot suppression

The production suppression allowlist must name each intentional lint
suppression; add the one this change introduces.
RomneyDa added a commit that referenced this pull request Nov 17, 2026
…change (#199944)

* fix(agents): core lint fails on the MCP catalog JSON snapshot

#199909 snapshots MCP catalog metadata through JSON on purpose, because the
round trip drops undefined members that structuredClone would keep. The
unicorn/prefer-structured-clone rule rejects that line, so check-lint-core-2
fails on main and on every pull request whose lint lanes include src/agents.
Record the reason with the repository's usual suppression.

* test(scripts): allow the MCP catalog JSON snapshot suppression

The production suppression allowlist must name each intentional lint
suppression; add the one this change introduces.

Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: vincentkoc <[email protected]>
RomneyDa added a commit that referenced this pull request Nov 17, 2026
…change (#199944)

* fix(agents): core lint fails on the MCP catalog JSON snapshot

#199909 snapshots MCP catalog metadata through JSON on purpose, because the
round trip drops undefined members that structuredClone would keep. The
unicorn/prefer-structured-clone rule rejects that line, so check-lint-core-2
fails on main and on every pull request whose lint lanes include src/agents.
Record the reason with the repository's usual suppression.

* test(scripts): allow the MCP catalog JSON snapshot suppression

The production suppression allowlist must name each intentional lint
suppression; add the one this change introduces.

Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: vincentkoc <[email protected]>
RomneyDa added a commit that referenced this pull request Nov 17, 2026
…change (#199944)

* fix(agents): core lint fails on the MCP catalog JSON snapshot

#199909 snapshots MCP catalog metadata through JSON on purpose, because the
round trip drops undefined members that structuredClone would keep. The
unicorn/prefer-structured-clone rule rejects that line, so check-lint-core-2
fails on main and on every pull request whose lint lanes include src/agents.
Record the reason with the repository's usual suppression.

* test(scripts): allow the MCP catalog JSON snapshot suppression

The production suppression allowlist must name each intentional lint
suppression; add the one this change introduces.

Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: vincentkoc <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 17, 2026
…change (openclaw#199944)

* fix(agents): core lint fails on the MCP catalog JSON snapshot

openclaw#199909 snapshots MCP catalog metadata through JSON on purpose, because the
round trip drops undefined members that structuredClone would keep. The
unicorn/prefer-structured-clone rule rejects that line, so check-lint-core-2
fails on main and on every pull request whose lint lanes include src/agents.
Record the reason with the repository's usual suppression.

* test(scripts): allow the MCP catalog JSON snapshot suppression

The production suppression allowlist must name each intentional lint
suppression; add the one this change introduces.
RomneyDa added a commit that referenced this pull request Nov 17, 2026
* fix(release): generate notes from large commit histories

Co-authored-by: vincentkoc <[email protected]>

Co-authored-by: RomneyDa <[email protected]>

* fix(release): generate notes from large commit histories

Worked on by:
- @vincentkoc

Co-authored-by: vincentkoc <[email protected]>
OpenClaw-Publication: 8c601281-d723-4553-9a10-e3f9692af6c2

* fix(ci): core lint fails on main after the MCP catalog JSON snapshot change (#199944)

* fix(agents): core lint fails on the MCP catalog JSON snapshot

#199909 snapshots MCP catalog metadata through JSON on purpose, because the
round trip drops undefined members that structuredClone would keep. The
unicorn/prefer-structured-clone rule rejects that line, so check-lint-core-2
fails on main and on every pull request whose lint lanes include src/agents.
Record the reason with the repository's usual suppression.

* test(scripts): allow the MCP catalog JSON snapshot suppression

The production suppression allowlist must name each intentional lint
suppression; add the one this change introduces.

Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: vincentkoc <[email protected]>

---------

Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: vincentkoc <[email protected]>
Co-authored-by: Patrick Erichsen <[email protected]>
RomneyDa added a commit that referenced this pull request Nov 17, 2026
…199923)

* fix(release): freeze published stable version in maintenance notices

Resolve published Latest for initial extended-stable notes instead of the tooling package version. Reuse canonical prepared or public notice context for readback and fresh-run recovery while keeping main-based retirement authority separate.

Co-authored-by: RomneyDa <[email protected]>

Co-authored-by: vincentkoc <[email protected]>

* fix(release): freeze published stable version in maintenance notices

Worked on by:
- @vincentkoc

Co-authored-by: vincentkoc <[email protected]>
OpenClaw-Publication: c6037000-9e46-442a-af64-4acf2707bc03

* fix(ci): core lint fails on main after the MCP catalog JSON snapshot change (#199944)

* fix(agents): core lint fails on the MCP catalog JSON snapshot

#199909 snapshots MCP catalog metadata through JSON on purpose, because the
round trip drops undefined members that structuredClone would keep. The
unicorn/prefer-structured-clone rule rejects that line, so check-lint-core-2
fails on main and on every pull request whose lint lanes include src/agents.
Record the reason with the repository's usual suppression.

* test(scripts): allow the MCP catalog JSON snapshot suppression

The production suppression allowlist must name each intentional lint
suppression; add the one this change introduces.

Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: vincentkoc <[email protected]>

---------

Co-authored-by: vincentkoc <[email protected]>
Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: Patrick Erichsen <[email protected]>
RomneyDa added a commit that referenced this pull request Nov 17, 2026
* fix(release): retry timed-out plugin source fetches

Route both exact-source manifest reads through the existing Git fetch
owner, preserving immutable targets and cleanup before bounded retries.
Prove timeout recovery at both workflow policy entry points.

Co-authored-by: vincentkoc <[email protected]>
Co-authored-by: RomneyDa <[email protected]>

* fix(release): retry timed-out plugin source fetches

Worked on by:
- @vincentkoc

Co-authored-by: vincentkoc <[email protected]>
OpenClaw-Publication: 44e02330-78d5-4a34-b429-49716c9c10dc

* fix(ci): core lint fails on main after the MCP catalog JSON snapshot change (#199944)

* fix(agents): core lint fails on the MCP catalog JSON snapshot

#199909 snapshots MCP catalog metadata through JSON on purpose, because the
round trip drops undefined members that structuredClone would keep. The
unicorn/prefer-structured-clone rule rejects that line, so check-lint-core-2
fails on main and on every pull request whose lint lanes include src/agents.
Record the reason with the repository's usual suppression.

* test(scripts): allow the MCP catalog JSON snapshot suppression

The production suppression allowlist must name each intentional lint
suppression; add the one this change introduces.

Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: vincentkoc <[email protected]>

* Publish openclaw/ledger-runtime

Worked on by:
- @vincentkoc

Co-authored-by: vincentkoc <[email protected]>
OpenClaw-Publication: 76d33b04-cb7e-4bdf-a924-c0ed6ce3dcaf

---------

Co-authored-by: vincentkoc <[email protected]>
Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: Patrick Erichsen <[email protected]>
RomneyDa added a commit that referenced this pull request Nov 17, 2026
* fix(release): retry timed-out plugin source fetches

Route both exact-source manifest reads through the existing Git fetch
owner, preserving immutable targets and cleanup before bounded retries.
Prove timeout recovery at both workflow policy entry points.

Release adaptation: none.

Companion review: Priority approved #199924: source b4190c2. Full plugin npm workflow and lifecycle tests read; shared Git fetch/run_git/git_output contract and test harness traced. Both exact-source package-read workflow entry points fail on first timed-out fetch, exit124 and no manifest;2 red failures/45 skipped in199924-red.log. Existing fetch owner retries bounded3, same exact SHA, blobless, drains children/reclaims owned locks before retry and preserves cancellation fencing. No new dependency; helper already present. Companion scan to c8d5cf5 finds no later path/source followups; neighbor plugin package policy suite is unchanged consumer and will be exercised. All-release ledger query has no sibling assessment. No publication/authority/artifact integrity policy changed.

Co-authored-by: vincentkoc <[email protected]>
Co-authored-by: RomneyDa <[email protected]>

* fix(release): retry timed-out plugin source fetches

Worked on by:
- @vincentkoc

Co-authored-by: vincentkoc <[email protected]>
OpenClaw-Publication: 44e02330-78d5-4a34-b429-49716c9c10dc

* fix(ci): core lint fails on main after the MCP catalog JSON snapshot change (#199944)

* fix(agents): core lint fails on the MCP catalog JSON snapshot

#199909 snapshots MCP catalog metadata through JSON on purpose, because the
round trip drops undefined members that structuredClone would keep. The
unicorn/prefer-structured-clone rule rejects that line, so check-lint-core-2
fails on main and on every pull request whose lint lanes include src/agents.
Record the reason with the repository's usual suppression.

* test(scripts): allow the MCP catalog JSON snapshot suppression

The production suppression allowlist must name each intentional lint
suppression; add the one this change introduces.

Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: vincentkoc <[email protected]>

* Publish openclaw/ledger-runtime

Worked on by:
- @vincentkoc

Co-authored-by: vincentkoc <[email protected]>
OpenClaw-Publication: 76d33b04-cb7e-4bdf-a924-c0ed6ce3dcaf

---------

Co-authored-by: vincentkoc <[email protected]>
Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: Patrick Erichsen <[email protected]>
(cherry picked from commit b4190c2)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 18, 2026
…9921)

* fix(release): generate notes from large commit histories

Co-authored-by: vincentkoc <[email protected]>

Co-authored-by: RomneyDa <[email protected]>

* fix(release): generate notes from large commit histories

Worked on by:
- @vincentkoc

Co-authored-by: vincentkoc <[email protected]>
OpenClaw-Publication: 8c601281-d723-4553-9a10-e3f9692af6c2

* fix(ci): core lint fails on main after the MCP catalog JSON snapshot change (openclaw#199944)

* fix(agents): core lint fails on the MCP catalog JSON snapshot

openclaw#199909 snapshots MCP catalog metadata through JSON on purpose, because the
round trip drops undefined members that structuredClone would keep. The
unicorn/prefer-structured-clone rule rejects that line, so check-lint-core-2
fails on main and on every pull request whose lint lanes include src/agents.
Record the reason with the repository's usual suppression.

* test(scripts): allow the MCP catalog JSON snapshot suppression

The production suppression allowlist must name each intentional lint
suppression; add the one this change introduces.

Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: vincentkoc <[email protected]>

---------

Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: vincentkoc <[email protected]>
Co-authored-by: Patrick Erichsen <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 18, 2026
…penclaw#199923)

* fix(release): freeze published stable version in maintenance notices

Resolve published Latest for initial extended-stable notes instead of the tooling package version. Reuse canonical prepared or public notice context for readback and fresh-run recovery while keeping main-based retirement authority separate.

Co-authored-by: RomneyDa <[email protected]>

Co-authored-by: vincentkoc <[email protected]>

* fix(release): freeze published stable version in maintenance notices

Worked on by:
- @vincentkoc

Co-authored-by: vincentkoc <[email protected]>
OpenClaw-Publication: c6037000-9e46-442a-af64-4acf2707bc03

* fix(ci): core lint fails on main after the MCP catalog JSON snapshot change (openclaw#199944)

* fix(agents): core lint fails on the MCP catalog JSON snapshot

openclaw#199909 snapshots MCP catalog metadata through JSON on purpose, because the
round trip drops undefined members that structuredClone would keep. The
unicorn/prefer-structured-clone rule rejects that line, so check-lint-core-2
fails on main and on every pull request whose lint lanes include src/agents.
Record the reason with the repository's usual suppression.

* test(scripts): allow the MCP catalog JSON snapshot suppression

The production suppression allowlist must name each intentional lint
suppression; add the one this change introduces.

Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: vincentkoc <[email protected]>

---------

Co-authored-by: vincentkoc <[email protected]>
Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: Patrick Erichsen <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 18, 2026
* fix(release): retry timed-out plugin source fetches

Route both exact-source manifest reads through the existing Git fetch
owner, preserving immutable targets and cleanup before bounded retries.
Prove timeout recovery at both workflow policy entry points.

Co-authored-by: vincentkoc <[email protected]>
Co-authored-by: RomneyDa <[email protected]>

* fix(release): retry timed-out plugin source fetches

Worked on by:
- @vincentkoc

Co-authored-by: vincentkoc <[email protected]>
OpenClaw-Publication: 44e02330-78d5-4a34-b429-49716c9c10dc

* fix(ci): core lint fails on main after the MCP catalog JSON snapshot change (openclaw#199944)

* fix(agents): core lint fails on the MCP catalog JSON snapshot

openclaw#199909 snapshots MCP catalog metadata through JSON on purpose, because the
round trip drops undefined members that structuredClone would keep. The
unicorn/prefer-structured-clone rule rejects that line, so check-lint-core-2
fails on main and on every pull request whose lint lanes include src/agents.
Record the reason with the repository's usual suppression.

* test(scripts): allow the MCP catalog JSON snapshot suppression

The production suppression allowlist must name each intentional lint
suppression; add the one this change introduces.

Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: vincentkoc <[email protected]>

* Publish openclaw/ledger-runtime

Worked on by:
- @vincentkoc

Co-authored-by: vincentkoc <[email protected]>
OpenClaw-Publication: 76d33b04-cb7e-4bdf-a924-c0ed6ce3dcaf

---------

Co-authored-by: vincentkoc <[email protected]>
Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: Patrick Erichsen <[email protected]>
RomneyDa added a commit that referenced this pull request Nov 19, 2026
* fix(release): generate notes from large commit histories

Co-authored-by: vincentkoc <[email protected]>

Co-authored-by: RomneyDa <[email protected]>

* fix(release): generate notes from large commit histories

Worked on by:
- @vincentkoc

Co-authored-by: vincentkoc <[email protected]>
OpenClaw-Publication: 8c601281-d723-4553-9a10-e3f9692af6c2

* fix(ci): core lint fails on main after the MCP catalog JSON snapshot change (#199944)

* fix(agents): core lint fails on the MCP catalog JSON snapshot

#199909 snapshots MCP catalog metadata through JSON on purpose, because the
round trip drops undefined members that structuredClone would keep. The
unicorn/prefer-structured-clone rule rejects that line, so check-lint-core-2
fails on main and on every pull request whose lint lanes include src/agents.
Record the reason with the repository's usual suppression.

* test(scripts): allow the MCP catalog JSON snapshot suppression

The production suppression allowlist must name each intentional lint
suppression; add the one this change introduces.

Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: vincentkoc <[email protected]>

---------

Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: vincentkoc <[email protected]>
Co-authored-by: Patrick Erichsen <[email protected]>
(cherry picked from commit cd7273f)
(cherry picked from commit 5f6b13f32862f5b403ae65aaa7c88f7cd3aba01e)
RomneyDa added a commit that referenced this pull request Nov 19, 2026
…199923)

* fix(release): freeze published stable version in maintenance notices

Resolve published Latest for initial extended-stable notes instead of the tooling package version. Reuse canonical prepared or public notice context for readback and fresh-run recovery while keeping main-based retirement authority separate.

Co-authored-by: RomneyDa <[email protected]>

Co-authored-by: vincentkoc <[email protected]>

* fix(release): freeze published stable version in maintenance notices

Worked on by:
- @vincentkoc

Co-authored-by: vincentkoc <[email protected]>
OpenClaw-Publication: c6037000-9e46-442a-af64-4acf2707bc03

* fix(ci): core lint fails on main after the MCP catalog JSON snapshot change (#199944)

* fix(agents): core lint fails on the MCP catalog JSON snapshot

#199909 snapshots MCP catalog metadata through JSON on purpose, because the
round trip drops undefined members that structuredClone would keep. The
unicorn/prefer-structured-clone rule rejects that line, so check-lint-core-2
fails on main and on every pull request whose lint lanes include src/agents.
Record the reason with the repository's usual suppression.

* test(scripts): allow the MCP catalog JSON snapshot suppression

The production suppression allowlist must name each intentional lint
suppression; add the one this change introduces.

Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: vincentkoc <[email protected]>

---------

Co-authored-by: vincentkoc <[email protected]>
Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: Patrick Erichsen <[email protected]>
(cherry picked from commit 263af8c)
(cherry picked from commit 7c7ba41b56fc7647f080343a11f18c8e8b7919f1)
RomneyDa added a commit that referenced this pull request Nov 19, 2026
* fix(release): retry timed-out plugin source fetches

Route both exact-source manifest reads through the existing Git fetch
owner, preserving immutable targets and cleanup before bounded retries.
Prove timeout recovery at both workflow policy entry points.

Co-authored-by: vincentkoc <[email protected]>
Co-authored-by: RomneyDa <[email protected]>

* fix(release): retry timed-out plugin source fetches

Worked on by:
- @vincentkoc

Co-authored-by: vincentkoc <[email protected]>
OpenClaw-Publication: 44e02330-78d5-4a34-b429-49716c9c10dc

* fix(ci): core lint fails on main after the MCP catalog JSON snapshot change (#199944)

* fix(agents): core lint fails on the MCP catalog JSON snapshot

#199909 snapshots MCP catalog metadata through JSON on purpose, because the
round trip drops undefined members that structuredClone would keep. The
unicorn/prefer-structured-clone rule rejects that line, so check-lint-core-2
fails on main and on every pull request whose lint lanes include src/agents.
Record the reason with the repository's usual suppression.

* test(scripts): allow the MCP catalog JSON snapshot suppression

The production suppression allowlist must name each intentional lint
suppression; add the one this change introduces.

Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: vincentkoc <[email protected]>

* Publish openclaw/ledger-runtime

Worked on by:
- @vincentkoc

Co-authored-by: vincentkoc <[email protected]>
OpenClaw-Publication: 76d33b04-cb7e-4bdf-a924-c0ed6ce3dcaf

---------

Co-authored-by: vincentkoc <[email protected]>
Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: Patrick Erichsen <[email protected]>
(cherry picked from commit b4190c2)
(cherry picked from commit 38c263d2bcd7bf4f6814a501dc99bbbaec9d17f3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant