Skip to content

fix: make Code Mode reliable across gateway and provider lifecycles - #115379

Merged
steipete merged 4 commits into
mainfrom
codex/code-mode-deep-stress-20260728
Jul 28, 2026
Merged

steipete merged 4 commits into
mainfrom
codex/code-mode-deep-stress-20260728

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes Code Mode runs that could retain all suspended execution slots after Gateway shutdown, leak process-global tool catalogs when preparation fails, lose cancellation for node-backed MCP calls, or silently strip legitimate direct-only tools from OpenAI and Copilot requests. Also fixes release validation that omitted the real packaged Code Mode gateway and accepted assistant text without proving execution.

Related: #115213, #115314.

Why This Change Was Made

Keeps run disposal and catalog cleanup at their canonical owners, forwards the existing caller signal to node invocations, derives the transport allowlist solely from each request-visible tool context, and reuses the existing deterministic packaged MCP gateway smoke in the release core. Product proof reads structured assistant tool calls through the existing session-store and session-transcript SDKs; no new config, protocol, storage, schema, or compatibility surface.

User Impact

Gateway restarts free all suspended Code Mode slots and outstanding work. Direct-only tools such as sessions_yield and structured_output remain available without exposing undeclared tools. Node calls respect cancellation. Release checks prove real packaged gateway execution and reject fabricated transcript evidence.

Evidence

  • Twelve independent frozen-main subsystem audits and direct upstream Codex contract inspection.
  • 967 passing Linux tests across six shards, including real worker isolation, 64-slot shutdown, deadline/cancellation, restart cleanup, both provider transports, node-backed MCP, and three failing-preparation catalog modes.
  • 130,000 adversarial parser, division, regular-expression, loader, and Unicode cases.
  • Full remote pnpm check:changed passed all production/test/script type checks, lint, SDK/export boundaries, package guards, and database-first checks.
  • Full pnpm build passed, including all 146 public Plugin SDK subpaths.
  • Fresh package passed tarball integrity and dist import-graph verification.
  • Real release-path mcp-code-mode-gateway Docker lane passed against the freshly built package, gateway, local mock provider, actual MCP fixture, and persisted structured exec evidence.
  • Fresh Codex autoreview: clean, no accepted or actionable findings.

AI-assisted and independently reviewed.

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime scripts Repository scripts docker Docker and sandbox tooling agents Agent runtime and tooling size: L maintainer Maintainer-authored PR labels Jul 28, 2026
@steipete
steipete merged commit 388bcc4 into main Jul 28, 2026
119 checks passed
@steipete
steipete deleted the codex/code-mode-deep-stress-20260728 branch July 28, 2026 19:21
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Jul 28, 2026
…etwork-none

* origin/main: (74 commits)
  fix(ui): make Control UI ownership and permissions reliable (#115364)
  feat(system-agent): host memory import in Ask OpenClaw (#115376)
  fix(chat): preserve literal Markdown image examples (#113904)
  refactor(chat): keep web and terminal sessions synchronized (#115377)
  fix(ui): order model picker by provider strength (#115380)
  feat(ui): make Memory settings a destination page with live overview and dreams (#115383)
  docs(security): fix warning line wrap (#115388)
  fix(memory-core): avoid cubic MMR similarity rescans (#113359)
  fix(discord): preserve code-leading reasoning chunks (#103166)
  fix(slack): protect outbound hooks from previews
  fix(ui): keep explicit navigation ahead of chat canonicalization (#115366)
  fix(exec): safely cancel pending node approvals (#115373)
  fix: make Code Mode reliable across gateway and provider lifecycles (#115379)
  perf(ui): debounce event-driven session list refreshes and right-size child paging (#115374)
  feat(talk): support GPT-Live realtime voice over ChatGPT OAuth (#115226)
  feat(system-agent): guide gateway configuration in Ask OpenClaw (#115363)
  fix(agents): make overflow recovery append-only via branch-and-reappend (#115271) (#115310)
  fix(macos): bound websocket ping so a dropped pong cannot orphan its continuation (#115362)
  fix(codex): isolate native hook relay startup (#115078)
  fix(ci): stop reviving superseded pull request workflows (#115378)
  ...

# Conflicts:
#	CHANGELOG.md
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 29, 2026
…penclaw#115379)

* fix(code-mode): dispose suspended runs and propagate cancellation

* fix(code-mode): preserve request-visible provider tools

* test(code-mode): require real packaged gateway execution

* fix(gateway): load code mode cleanup only during shutdown
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling docker Docker and sandbox tooling gateway Gateway runtime maintainer Maintainer-authored PR scripts Repository scripts size: L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant