Skip to content

fix: honor composer prediction deadlines and cancel on send - #418

Merged
iililiiilili merged 2 commits into
mainfrom
fix/composer-predictions-timeout
Oct 29, 2026
Merged

iililiiilili merged 2 commits into
mainfrom
fix/composer-predictions-timeout

Conversation

@iililiiilili

@iililiiilili iililiiilili commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #412

What Problem This Solves

Fixes an issue where Web composer predictions disappeared after ten seconds when a configured company model responded slowly. Separate browser, BFF, inference, and internal RPC deadlines prevented operators from choosing an appropriate wait. A new browser message also needed to cancel the previous prediction at dispatch, before its acknowledgment or the next model call.

Why This Change Was Made

The admin HTTP plugin owns composerPredictionsTimeoutMs and advertises it to the authenticated Web client and BFF. Its default is 30,000 ms, with integer values from 1,000 to 300,000 ms. The BFF includes elapsed authorization/history time and passes the operation budget through the existing internal RPC transport.

The canonical browser request observes the existing transport onSent callback. It retires the matching client/session's pending prediction immediately. A delayed acknowledgment can adopt the returned run ID without generating another dispatch cancellation; the old queue-only provenance write is removed.

The CI follow-up fixes three type-aware lint diagnostics in the new abort/deadline tests. It also pins only @openclaw/crabline>re2js to 2.8.7, the patched version for GHSA-gg6h-894w-4m9c. Crabline 0.1.11 pins vulnerable 2.8.6 exactly; the parent-scoped override and lockfile must move together. Remove the override when Crabline adopts the patch. Audit policy remains unchanged.

User Impact

After deploying an image containing this change, operators can merge this example into plugins.entries.admin-http-rpc.config:

{
  "composerPredictionsEnabled": true,
  "composerPredictionsTimeoutMs": 60000
}

Server enablement and account preferences retain their existing behavior and defaults. The model environment setting, private-network restriction, context/output bounds, single prediction slot, and priority for ordinary model calls remain in place. Refresh the Web page after changing the configured deadline.

Evidence

  • Focused repository Vitest wrappers: 383 tests across seven files, including configured delays beyond ten seconds, real HTTP cancellation, interrupted response cleanup, dispatch before a pending acknowledgment, stale replies, unchanged feature gates, and session-creation no-send guards. Affected files were rerun after correcting test assertions/style. An omitted tracked JSON resource was materialized before the successful session-creation test run.
  • Linux Chromium composer E2E: 1/1 passed with wrapper exit 0 under a process subreaper. Ghost-text and Tab-insertion screenshots were inspected; the initial container cleanup failure is retained separately from the successful rerun.
  • Manifest validation uses the actual public SDK validator: timeout bounds/defaults are accepted and explicit server enablement is preserved.
  • Fresh structured Codex autoreview (--mode uncommitted --engine codex) including the CI repair: exit 0, no accepted/actionable P0 findings. The sparse review copy's full-index diff and all 20 changed file hashes match the implementation checkout. The affected plugin tests passed again: 30 tests across two files.
  • Linux core production typecheck passed. The required full owner-overlay check was attempted with the same --overlay-only routing as PlatformClaw CI, but its unchanged SDK declaration preparation hit the normal 300-second limit before the lint/type gates could complete. Whole-core test types were stopped during measured host memory pressure. Neither incomplete run is counted as passing; the required existing GitHub CI must verify remaining type/lint/build gates at this head.
  • CI at the original head 9c214f883b8c4ac29f544a60c06c98389717e3af completed: 62 checks passed, including builds, UI E2E, and Docker Smoke. The failing lint/security jobs prompted the follow-up above; the final gate failed as a consequence.
  • Repair head bdd0a42902201059e77b1d7dbd458c2b7d8fe52a: CI, PlatformClaw CI, and Docker Smoke. The new security-fast check passes; remaining runtime/lint checks are running. The dependency guard requires a repository administrator's current-head approval via the existing /allow-dependencies-change flow; see the guard result.
  • Linux Node 24.18.0 / pnpm 11.15.1 dependency proof: lockfile-only regeneration is byte-identical; a normal frozen installation passes; the published 2.8.7 tarball SHA-512 matches the registry and lock. Actual Crabline dependency resolution and six regex contracts pass. Dependency pins validate (639 specs / 186 manifests); the unchanged production audit reports no high-or-higher advisories.
  • The CI-repair local type-aware lint attempt could not reach linting because the unchanged SDK declaration preparation timed out at its existing 300-second limit. This is recorded as a proof gap, not a passing lint result; the exact-head hosted checks above run the required lint/type gates. Task-owned Linux resources were removed after exporting logs.
  • Real company-model latency, GPU cancellation, and production deployment are not verified.

Configuration surfaces: one added plugin setting and a prediction deadline default of 30 seconds instead of ten. Server/account enablement defaults are unchanged. The original production/config delta is +170/-55 lines; the CI repair adds two workspace security-policy lines and a +6/-5 dependency lock delta, with no new production logic. Tests are counted separately. Growth implements the operator deadline contract and the canonical dispatch cancellation boundary. No database/protocol version changes. Codex review isolation flags were checked directly in the sibling codex-rs/exec/src/cli.rs:36 source.

@iililiiilili
iililiiilili marked this pull request as ready for review October 29, 2026 06:00
@github-actions

Copy link
Copy Markdown
Contributor

Dependency Guard

This PR changes dependency-related files. Maintainers should confirm these changes are intentional.

Changed files:

  • pnpm-lock.yaml
  • pnpm-workspace.yaml

Maintainer follow-up:

  • Review whether the dependency changes are intentional.
  • Inspect resolved package deltas when lockfiles or workspace dependency policy changes are present.
  • Treat pnpm-lock.yaml and package-lock.json diffs as dependency security-review surfaces.
  • Run pnpm deps:changes:report -- --base-ref origin/main --markdown /tmp/dependency-changes.md --json /tmp/dependency-changes.json locally for detailed release-style evidence.

@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Dependency graph change authorized

This PR includes dependency graph changes. A repository admin or member of @openclaw/openclaw-secops authorized this exact head SHA with /allow-dependencies-change.

  • Approved SHA: bdd0a42902201059e77b1d7dbd458c2b7d8fe52a
  • Approved by: @devSejung

A later push changes the PR head SHA and requires a fresh security approval.

@devSejung

Copy link
Copy Markdown
Owner

/allow-dependencies-change

@iililiiilili
iililiiilili merged commit 15c7ef4 into main Oct 29, 2026
81 of 82 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants