Skip to content

fix(agents): forward memory flush write path#41761

Merged
frankekn merged 2 commits intomainfrom
fix/38574-memory-flush-forwarding
Mar 10, 2026
Merged

fix(agents): forward memory flush write path#41761
frankekn merged 2 commits intomainfrom
fix/38574-memory-flush-forwarding

Conversation

@frankekn
Copy link
Copy Markdown
Contributor

Summary

  • forward memoryFlushWritePath through runEmbeddedPiAgent into runEmbeddedAttempt
  • add a regression test that fails if memory-triggered runs drop the append-only path guard
  • add a changelog follow-up for the post-merge memory flush fix

Context

This follows up on #38574. A post-merge review found that memory-triggered flush turns passed memoryFlushWritePath into runEmbeddedPiAgent, but that parameter was not forwarded into runEmbeddedAttempt, causing the new guard in createOpenClawCodingTools to throw before tool setup.

Testing

  • pnpm test src/agents/pi-embedded-runner/usage-reporting.test.ts src/agents/pi-tools.workspace-only-false.test.ts
  • pnpm exec oxlint src/agents/pi-embedded-runner/run.ts src/agents/pi-embedded-runner/usage-reporting.test.ts CHANGELOG.md
  • pnpm exec oxfmt --check src/agents/pi-embedded-runner/run.ts src/agents/pi-embedded-runner/usage-reporting.test.ts CHANGELOG.md
  • pnpm build

@openclaw-barnacle openclaw-barnacle bot added agents Agent runtime and tooling size: XS maintainer Maintainer-authored PR labels Mar 10, 2026
@frankekn frankekn self-assigned this Mar 10, 2026
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 10, 2026

Greptile Summary

This PR fixes a one-line forwarding gap in runEmbeddedPiAgent: memoryFlushWritePath was accepted by the function's parameter type but never passed down into the inner runEmbeddedAttempt call, causing the append-only write guard in createOpenClawCodingTools to throw on every memory-triggered flush turn. The fix is minimal and surgical — one new property forwarded in run.ts — and is accompanied by a focused regression test that will catch any future regression at the runEmbeddedPiAgentrunEmbeddedAttempt boundary.

  • src/agents/pi-embedded-runner/run.ts — adds memoryFlushWritePath: params.memoryFlushWritePath to the runEmbeddedAttempt call object, consistent with the placement of trigger and the style of every other forwarded field in the same block.
  • src/agents/pi-embedded-runner/usage-reporting.test.ts — adds a regression test that invokes runEmbeddedPiAgent with trigger: "memory" and memoryFlushWritePath, then asserts the mocked runEmbeddedAttempt received both. The mock infrastructure is correctly reused from the shared fixture.
  • CHANGELOG.md — entry accurately describes the fix; minor style note: it omits the (#41761) PR reference that all neighbouring entries include.

Confidence Score: 5/5

  • This PR is safe to merge — the change is a minimal, targeted one-line forwarding fix with a regression test.
  • The fix is a single property addition to an existing object literal, directly addressing a confirmed missing forward. The parameter type already existed in both the source and destination; no new logic or branching is introduced. The regression test is correctly wired to the shared mock infrastructure and will catch future regressions. The only observation is a minor CHANGELOG style inconsistency (missing PR reference), which is cosmetic and does not affect correctness.
  • No files require special attention.

Last reviewed commit: ffecc35

CHANGELOG.md Outdated
- Telegram/exec approvals: reject `/approve` commands aimed at other bots, keep deterministic approval prompts visible when tool-result delivery fails, and stop resolved exact IDs from matching other pending approvals by prefix. (#37233) Thanks @huntharo.
- Control UI/Sessions: restore single-column session table collapse on narrow viewport or container widths by moving the responsive table override next to the base grid rule and enabling inline-size container queries. (#12175) Thanks @benjipeng.
- Telegram/final preview delivery: split active preview lifecycle from cleanup retention so missing archived preview edits avoid duplicate fallback sends without clearing the live preview or blocking later in-place finalization. (#41662) thanks @hougangdev.
- Agents/memory flush: forward `memoryFlushWritePath` through `runEmbeddedPiAgent` so memory-triggered flush turns keep the append-only write guard without aborting before tool setup. Follows up on #38574.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Missing PR reference in changelog entry

Every other entry in this section includes a (#XXXXX) PR reference at the end (e.g., (#41662) thanks @hougangdev.). This entry omits the current PR number (#41761), which breaks the consistent pattern and makes it harder to trace back the source of this change later.

Suggested change
- Agents/memory flush: forward `memoryFlushWritePath` through `runEmbeddedPiAgent` so memory-triggered flush turns keep the append-only write guard without aborting before tool setup. Follows up on #38574.
- Agents/memory flush: forward `memoryFlushWritePath` through `runEmbeddedPiAgent` so memory-triggered flush turns keep the append-only write guard without aborting before tool setup. Follows up on #38574. (#41761)
Prompt To Fix With AI
This is a comment left during a code review.
Path: CHANGELOG.md
Line: 50

Comment:
**Missing PR reference in changelog entry**

Every other entry in this section includes a `(#XXXXX)` PR reference at the end (e.g., `(#41662) thanks @hougangdev.`). This entry omits the current PR number `(#41761)`, which breaks the consistent pattern and makes it harder to trace back the source of this change later.

```suggestion
- Agents/memory flush: forward `memoryFlushWritePath` through `runEmbeddedPiAgent` so memory-triggered flush turns keep the append-only write guard without aborting before tool setup. Follows up on #38574. (#41761)
```

How can I resolve this? If you propose a fix, please make it concise.

@frankekn frankekn force-pushed the fix/38574-memory-flush-forwarding branch 2 times, most recently from e601fed to b5f12c8 Compare March 10, 2026 06:05
@frankekn frankekn force-pushed the fix/38574-memory-flush-forwarding branch from b5f12c8 to 0a8ebf8 Compare March 10, 2026 06:07
@frankekn frankekn merged commit 8306eab into main Mar 10, 2026
29 checks passed
@frankekn frankekn deleted the fix/38574-memory-flush-forwarding branch March 10, 2026 06:18
mukhtharcm pushed a commit to hnykda/openclaw that referenced this pull request Mar 10, 2026
Merged via squash.

Prepared head SHA: 0a8ebf8
Co-authored-by: frankekn <[email protected]>
Co-authored-by: frankekn <[email protected]>
Reviewed-by: @frankekn
mrosmarin added a commit to mrosmarin/openclaw that referenced this pull request Mar 10, 2026
* main: (43 commits)
  docs: add openclaw#42173 to CHANGELOG — strip leaked model control tokens (openclaw#42216)
  Agents: align onPayload callback and OAuth imports
  docs: add Tengji (George) Zhang to maintainer table (openclaw#42190)
  fix: strip leaked model control tokens from user-facing text (openclaw#42173)
  Changelog: add unreleased March 9 entries
  chore: add .dev-state to .gitignore (openclaw#41848)
  fix(agents): avoid duplicate same-provider cooldown probes in fallback runs (openclaw#41711)
  fix(mattermost): preserve markdown formatting and native tables (openclaw#18655)
  feat(acp): add resumeSessionId to sessions_spawn for ACP session resume (openclaw#41847)
  ACPX: bump bundled acpx to 0.1.16 (openclaw#41975)
  mattermost: fix DM media upload for unprefixed user IDs (openclaw#29925)
  fix(msteams): use General channel conversation ID as team key for Bot Framework compatibility (openclaw#41838)
  fix(mattermost): read replyTo param in plugin handleAction send (openclaw#41176)
  fix(sandbox): pass real workspace to sessions_spawn when workspaceAccess is ro (openclaw#40757)
  fix(ui): replace Manual RPC text input with sorted method dropdown (openclaw#14967)
  CI: select Swift 6.2 toolchain for CodeQL (openclaw#41787)
  fix(agents): forward memory flush write path (openclaw#41761)
  fix(telegram): move network fallback to resolver-scoped dispatchers (openclaw#40740)
  fix(security): harden replaceMarkers() to catch space/underscore boundary marker variants (openclaw#35983)
  fix(web-search): recover OpenRouter Perplexity citations from message annotations (openclaw#40881)
  ...
aiwatching pushed a commit to aiwatching/openclaw that referenced this pull request Mar 10, 2026
Merged via squash.

Prepared head SHA: 0a8ebf8
Co-authored-by: frankekn <[email protected]>
Co-authored-by: frankekn <[email protected]>
Reviewed-by: @frankekn
Moshiii pushed a commit to Moshiii/openclaw that referenced this pull request Mar 11, 2026
Merged via squash.

Prepared head SHA: 0a8ebf8
Co-authored-by: frankekn <[email protected]>
Co-authored-by: frankekn <[email protected]>
Reviewed-by: @frankekn
Moshiii pushed a commit to Moshiii/openclaw that referenced this pull request Mar 11, 2026
Merged via squash.

Prepared head SHA: 0a8ebf8
Co-authored-by: frankekn <[email protected]>
Co-authored-by: frankekn <[email protected]>
Reviewed-by: @frankekn
frankekn added a commit to MoerAI/openclaw that referenced this pull request Mar 11, 2026
Merged via squash.

Prepared head SHA: 0a8ebf8
Co-authored-by: frankekn <[email protected]>
Co-authored-by: frankekn <[email protected]>
Reviewed-by: @frankekn
frankekn added a commit to Effet/openclaw that referenced this pull request Mar 11, 2026
Merged via squash.

Prepared head SHA: 0a8ebf8
Co-authored-by: frankekn <[email protected]>
Co-authored-by: frankekn <[email protected]>
Reviewed-by: @frankekn
frankekn added a commit to ImLukeF/openclaw that referenced this pull request Mar 11, 2026
Merged via squash.

Prepared head SHA: 0a8ebf8
Co-authored-by: frankekn <[email protected]>
Co-authored-by: frankekn <[email protected]>
Reviewed-by: @frankekn
dominicnunez pushed a commit to dominicnunez/openclaw that referenced this pull request Mar 11, 2026
Merged via squash.

Prepared head SHA: 0a8ebf8
Co-authored-by: frankekn <[email protected]>
Co-authored-by: frankekn <[email protected]>
Reviewed-by: @frankekn
dhoman pushed a commit to dhoman/chrono-claw that referenced this pull request Mar 11, 2026
Merged via squash.

Prepared head SHA: 0a8ebf8
Co-authored-by: frankekn <[email protected]>
Co-authored-by: frankekn <[email protected]>
Reviewed-by: @frankekn
ahelpercn pushed a commit to ahelpercn/openclaw that referenced this pull request Mar 12, 2026
Merged via squash.

Prepared head SHA: 0a8ebf8
Co-authored-by: frankekn <[email protected]>
Co-authored-by: frankekn <[email protected]>
Reviewed-by: @frankekn
Ruijie-Ysp pushed a commit to Ruijie-Ysp/clawdbot that referenced this pull request Mar 12, 2026
Merged via squash.

Prepared head SHA: 0a8ebf8
Co-authored-by: frankekn <[email protected]>
Co-authored-by: frankekn <[email protected]>
Reviewed-by: @frankekn
qipyle pushed a commit to qipyle/openclaw that referenced this pull request Mar 12, 2026
Merged via squash.

Prepared head SHA: 0a8ebf8
Co-authored-by: frankekn <[email protected]>
Co-authored-by: frankekn <[email protected]>
Reviewed-by: @frankekn
Interstellar-code pushed a commit to Interstellar-code/operator1 that referenced this pull request Mar 16, 2026
Merged via squash.

Prepared head SHA: 0a8ebf8
Co-authored-by: frankekn <[email protected]>
Co-authored-by: frankekn <[email protected]>
Reviewed-by: @frankekn

(cherry picked from commit 8306eab)
senw-developers pushed a commit to senw-developers/va-openclaw that referenced this pull request Mar 17, 2026
Merged via squash.

Prepared head SHA: 0a8ebf8
Co-authored-by: frankekn <[email protected]>
Co-authored-by: frankekn <[email protected]>
Reviewed-by: @frankekn
V-Gutierrez pushed a commit to V-Gutierrez/openclaw-vendor that referenced this pull request Mar 17, 2026
Merged via squash.

Prepared head SHA: 0a8ebf8
Co-authored-by: frankekn <[email protected]>
Co-authored-by: frankekn <[email protected]>
Reviewed-by: @frankekn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling maintainer Maintainer-authored PR size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant