Skip to content

fix(active-memory): preserve setup grace for embedded recall#74480

Merged
steipete merged 1 commit into
openclaw:mainfrom
9876543210-tc-0123456789:fix/73306-active-memory-timeout
May 3, 2026
Merged

fix(active-memory): preserve setup grace for embedded recall#74480
steipete merged 1 commit into
openclaw:mainfrom
9876543210-tc-0123456789:fix/73306-active-memory-timeout

Conversation

@9876543210-tc-0123456789

@9876543210-tc-0123456789 9876543210-tc-0123456789 commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fixes Active Memory setup grace at the embedded-runner boundary.
  • Previously the outer prompt-build watchdog used timeoutMs + setupGraceTimeoutMs, but runEmbeddedPiAgent still received raw timeoutMs and could self-timeout first.
  • Now the embedded recall runner receives the same effective timeout budget as the outer watchdog.
  • Also updates the focused regression test, changelog, and Active Memory docs.

Scope

This is intentionally narrow. It does not change memory search behavior, provider routing, circuit breaker behavior, model selection, or timeout clamps.

Verification

  • pnpm exec oxfmt --check --threads=1 CHANGELOG.md docs/concepts/active-memory.md extensions/active-memory/index.ts extensions/active-memory/index.test.ts
  • pnpm test extensions/active-memory/index.test.ts extensions/active-memory/config.test.ts
  • pnpm check:docs
  • pnpm lint:extensions -- extensions/active-memory/index.ts extensions/active-memory/index.test.ts
  • git diff --check

Notes

Rewritten on current main as a single maintainer patch while preserving contributor credit.

Closes #73306.

@clawsweeper

clawsweeper Bot commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

Summary
The PR applies setupGraceTimeoutMs to the Active Memory embedded recall runner timeout and updates the focused regression assertion, Active Memory docs, and changelog.

Reproducibility: yes. Source inspection on current main shows the raw inner timeout handoff while the outer hook and watchdog use timeoutMs + setupGraceTimeoutMs; the focused unit harness has a setup-grace scenario that the PR updates to assert the combined embedded timeout.

Next step before merge
No ClawSweeper repair job is needed because the PR already contains the narrow code, regression, docs, and changelog changes; ordinary merge handling should gate it.

Security
Cleared: The diff only changes Active Memory timeout arithmetic plus colocated tests, docs, and changelog text, with no dependency, workflow, permission, package, or secret-handling changes.

Review details

Best possible solution:

Land this PR after ordinary maintainer merge handling so Active Memory uses one setup-grace-aware timeout budget across the hook, watchdog, and embedded runner.

Do we have a high-confidence way to reproduce the issue?

Yes. Source inspection on current main shows the raw inner timeout handoff while the outer hook and watchdog use timeoutMs + setupGraceTimeoutMs; the focused unit harness has a setup-grace scenario that the PR updates to assert the combined embedded timeout.

Is this the best way to solve the issue?

Yes. Passing the resolved timeoutMs + setupGraceTimeoutMs into runEmbeddedPiAgent is the narrowest maintainable fix because it preserves existing clamps and aligns all Active Memory timeout layers without changing recall behavior.

What I checked:

  • Current main raw embedded timeout: Current main still calls runEmbeddedPiAgent with timeoutMs: params.config.timeoutMs, so the embedded runner can self-timeout before the outer setup-grace-aware watchdog. (extensions/active-memory/index.ts:2289, 54a81e00807b)
  • Outer budgets already include setup grace: The Active Memory watchdog uses params.config.timeoutMs + params.config.setupGraceTimeoutMs, and hook registration also uses the combined budget. (extensions/active-memory/index.ts:2436, 54a81e00807b)
  • Embedded runner consumes caller timeout: The embedded runner configures its HTTP runtime and schedules the run abort timer from params.timeoutMs, making the Active Memory handoff value behaviorally significant. (src/agents/pi-embedded-runner/run/attempt.ts:709, 54a81e00807b)
  • PR head fixes the handoff: The PR computes embeddedTimeoutMs from the resolved config timeout plus setup grace and passes that value to runEmbeddedPiAgent. (extensions/active-memory/index.ts:2275, 5305f9c9f7fc)
  • Regression, docs, and changelog included: The PR updates the setup-grace assertion to expect the combined budget, removes the now-stale docs caveat, and adds an Unreleased Fixes changelog entry crediting the contributor. (extensions/active-memory/index.test.ts:2259, 5305f9c9f7fc)
  • Head checks: GitHub check-runs for the PR head include successful check, check-prod-types, check-docs, check-lint, build-artifacts, and security fast checks; only expected skipped/cancelled non-gating automation appears in the list. (5305f9c9f7fc)

Likely related people:

  • vincentkoc: Local blame attributes the current Active Memory embedded-runner call, setup-grace watchdog, and focused test block in this checkout to commit ea45950a9d8e, which introduced the current files in available history. (role: current-line history owner; confidence: medium; commits: ea45950a9d8e; files: extensions/active-memory/index.ts, extensions/active-memory/index.test.ts)
  • hyspacex: Related merged PR fix(active-memory): preserve setup time outside recall timeout #72620 added the plugin-level setup grace behavior and regression coverage that this PR finishes applying across the embedded-runner boundary. (role: setup-grace feature introducer; confidence: medium; commits: 4203f288fcba; files: extensions/active-memory/index.ts, extensions/active-memory/index.test.ts)
  • steipete: The latest discussion says steipete rewrote the branch as a narrow maintainer patch, and local history shows recent adjacent Active Memory maintenance in 5e9135f2e2. (role: recent maintainer and PR rewriter; confidence: high; commits: 5305f9c9f7fc, 5e9135f2e23d; files: extensions/active-memory/index.ts, extensions/active-memory/index.test.ts, CHANGELOG.md)
  • RayWoo: The merged setup-grace documentation PR introduced the docs caveat that this PR removes once the embedded-runner budget is fixed. (role: recent docs maintainer; confidence: medium; commits: 153e4c59cfd5; files: docs/concepts/active-memory.md)

Codex review notes: model gpt-5.5, reasoning high; reviewed against 54a81e00807b.

@steipete
steipete force-pushed the fix/73306-active-memory-timeout branch from b2e884b to 5305f9c Compare May 3, 2026 11:32
@openclaw-barnacle openclaw-barnacle Bot added the docs Improvements or additions to documentation label May 3, 2026
@steipete

steipete commented May 3, 2026

Copy link
Copy Markdown
Contributor

Rewrote this PR on current main as a narrow maintainer patch while preserving contributor credit.

What changed:

Local proof:

  • pnpm exec oxfmt --check --threads=1 CHANGELOG.md docs/concepts/active-memory.md extensions/active-memory/index.ts extensions/active-memory/index.test.ts
  • pnpm test extensions/active-memory/index.test.ts extensions/active-memory/config.test.ts
  • pnpm check:docs
  • pnpm lint:extensions -- extensions/active-memory/index.ts extensions/active-memory/index.test.ts
  • git diff --check

@steipete
steipete merged commit 1d657b9 into openclaw:main May 3, 2026
85 of 86 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Active Memory plugin times out on every run (15s timeout, 0 chars output) - v2026.4.26

2 participants