openclaw - 💡(How to fix) Fix [Bug]: sessions_send into reused fixed workbench succeeds, but timeout/announce can return stale previous-round results [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#60924Fetched 2026-04-08 02:45:36
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0

When reusing an existing agent workbench session via sessions_send(sessionKey=...), the target session can successfully receive the new user message, execute the new task in the same session, and produce a correct new final answer in its transcript. However, the runtime timeout / completion announce sent back to the caller may incorrectly contain stale content from the previous round.

This creates a misleading failure mode:

  • session reuse actually works
  • no new session is created
  • the target transcript contains the new task and new answer
  • but the caller sees an old result and may incorrectly conclude that reuse failed

Root Cause

Extra note

This bug is especially confusing because it appears only after the permissions/configuration chain has already been fixed. In our case:

  • visibility problems were resolved
  • agentToAgent.allow problems were resolved
  • fixed workbench reuse then started working
  • but timeout / announce still falsely suggested failure

Fix Action

Fix / Workaround

Repro steps

  1. Create two reusable workbench sessions for child agents (for example pm and frontend).
  2. First round: dispatch a task into each workbench, e.g. "today's international headlines".
  3. Second round: dispatch a different task into the same existing sessionKey via sessions_send, e.g. "today's AI headlines".
  4. Observe that:
    • no new session key is created
    • the target .jsonl transcript receives the second-round user message with provenance.kind = inter_session
    • the target transcript continues executing and eventually produces a correct second-round final answer
    • but timeout / announce returned to the caller may contain the first-round result instead of the second-round result
RAW_BUFFERClick to expand / collapse

OpenClaw Issue Draft: fixed workbench reuse succeeds, but timeout / announce can return stale previous-round results

Suggested title

[Bug]: sessions_send into reused fixed workbench succeeds and executes in-place, but timeout / announce may surface stale previous-round results

Summary

When reusing an existing agent workbench session via sessions_send(sessionKey=...), the target session can successfully receive the new user message, execute the new task in the same session, and produce a correct new final answer in its transcript. However, the runtime timeout / completion announce sent back to the caller may incorrectly contain stale content from the previous round.

This creates a misleading failure mode:

  • session reuse actually works
  • no new session is created
  • the target transcript contains the new task and new answer
  • but the caller sees an old result and may incorrectly conclude that reuse failed

Environment

  • OpenClaw local install via npm package path /opt/homebrew/lib/node_modules/openclaw
  • macOS arm64
  • Control UI / webchat surface
  • tools config includes:
    • tools.sessions.visibility = "all"
    • tools.agentToAgent.enabled = true
    • tools.agentToAgent.allow includes main, pm, frontend, etc.

Repro steps

  1. Create two reusable workbench sessions for child agents (for example pm and frontend).
  2. First round: dispatch a task into each workbench, e.g. "today's international headlines".
  3. Second round: dispatch a different task into the same existing sessionKey via sessions_send, e.g. "today's AI headlines".
  4. Observe that:
    • no new session key is created
    • the target .jsonl transcript receives the second-round user message with provenance.kind = inter_session
    • the target transcript continues executing and eventually produces a correct second-round final answer
    • but timeout / announce returned to the caller may contain the first-round result instead of the second-round result

What we verified from transcripts

We verified this directly from local session JSONL logs.

Reused session behavior is correct

  • original session keys remained unchanged
  • second-round user messages were appended into the original transcript
  • second-round tasks executed successfully in-place
  • no extra session key was created for the second round

Wrong part is the caller-facing returned content

The stale content appears in timeout / announce delivery, not in the target transcript.

Example symptoms

  • caller sends: "第二轮任务:查今天的热点 AI 新闻"
  • target transcript stores that exact message
  • target transcript later produces correct AI-news output
  • caller receives old first-round "international headlines" content instead

Expected behavior

The caller-facing timeout / announce path should reflect either:

  1. the latest actually produced result for the current message, or
  2. a neutral timeout status without replaying stale previous-round content

It should never surface previous-round answer content as if it were the current round result.

Actual behavior

The current round may time out at the caller side while still later surfacing a stale previous-round answer payload, even though the target transcript already shows the new round was accepted and executed.

Impact

This makes reusable workbench sessions look broken even when they are functioning correctly. It also misleads operators into thinking they need to respawn new sessions, which can worsen session explosion.

Extra note

This bug is especially confusing because it appears only after the permissions/configuration chain has already been fixed. In our case:

  • visibility problems were resolved
  • agentToAgent.allow problems were resolved
  • fixed workbench reuse then started working
  • but timeout / announce still falsely suggested failure

extent analysis

TL;DR

The most likely fix involves updating the timeout / announce logic to reflect the latest result for the current message in reused workbench sessions.

Guidance

  • Review the sessions_send function to ensure it correctly updates the result for the current message in the reused session.
  • Verify that the timeout / announce mechanism is checking the latest result in the target transcript instead of caching or replaying previous results.
  • Consider adding a check to clear or update any cached results when a new message is sent to a reused session.
  • Investigate the tools.sessions.visibility and tools.agentToAgent.enabled configurations to ensure they are not contributing to the stale content issue.

Example

No code snippet is provided due to the lack of specific implementation details in the issue.

Notes

The fix may require changes to the OpenClaw library or the application code using it. The issue seems to be related to the reuse of workbench sessions and the handling of results in the timeout / announce mechanism.

Recommendation

Apply a workaround to update the timeout / announce logic to reflect the latest result for the current message in reused workbench sessions, as the root cause of the issue is likely related to the handling of cached results.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

The caller-facing timeout / announce path should reflect either:

  1. the latest actually produced result for the current message, or
  2. a neutral timeout status without replaying stale previous-round content

It should never surface previous-round answer content as if it were the current round result.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING