Skip to content

fix(agents): preserve announce threadId on sessions.list fallback#63506

Merged
jalehman merged 2 commits into
openclaw:mainfrom
SnowSky1:codex/63469-a2a-threadid
Apr 9, 2026
Merged

fix(agents): preserve announce threadId on sessions.list fallback#63506
jalehman merged 2 commits into
openclaw:mainfrom
SnowSky1:codex/63469-a2a-threadid

Conversation

@SnowSky1

@SnowSky1 SnowSky1 commented Apr 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • preserve threadId when resolveAnnounceTarget() falls back to sessions.list
  • carry deliveryContext.threadId and lastThreadId through announce target hydration
  • add regression coverage for both target resolution and final A2A announce delivery

Root cause

The legacy A2A announce fallback rehydrated channel, to, and accountId from sessions.list, but it dropped thread/topic context. As a result, final announce deliveries were sent to the top-level channel instead of the originating thread/topic.

Verification

  • pnpm test -- src/agents/tools/sessions.test.ts src/agents/openclaw-tools.sessions.test.ts
  • pnpm exec oxfmt --check src/agents/tools/sessions-helpers.ts src/agents/tools/sessions-announce-target.ts src/agents/tools/sessions.test.ts src/agents/openclaw-tools.sessions.test.ts

Closes #63469

@SnowSky1

SnowSky1 commented Apr 9, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@greptile-apps

greptile-apps Bot commented Apr 9, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes a bug where the A2A announce fallback path (resolveAnnounceTarget via sessions.list) rehydrated channel, to, and accountId but silently dropped threadId, causing announce deliveries to land in the top-level channel instead of the originating thread/topic. The fix adds lastThreadId to SessionListRow, reads it (and deliveryContext.threadId) in resolveAnnounceTarget, normalizes both to a string via the existing normalizeOptionalStringifiedId helper, and includes it in the returned AnnounceTarget.

Confidence Score: 5/5

Safe to merge — the change is narrow, well-targeted, and covered by both unit and integration tests.

The fix is minimal and correct: it reads deliveryContext.threadId and the new lastThreadId field (in the same priority order as all other deliveryContext vs last* fields), normalizes via the existing helper, and returns it as part of AnnounceTarget. All remaining findings are P2 or below. Tests validate both code paths (deliveryContext and lastThreadId) as well as the full end-to-end announce delivery.

No files require special attention.

Vulnerabilities

No security concerns identified.

Reviews (1): Last reviewed commit: "fix(agents): preserve announce threadId ..." | Re-trigger Greptile

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@jalehman jalehman self-assigned this Apr 9, 2026
@jalehman jalehman force-pushed the codex/63469-a2a-threadid branch from 0ba7653 to 96a1fa0 Compare April 9, 2026 22:44
@jalehman jalehman force-pushed the codex/63469-a2a-threadid branch from 96a1fa0 to a81e85d Compare April 9, 2026 23:01
@jalehman jalehman merged commit 03f2951 into openclaw:main Apr 9, 2026
25 of 26 checks passed
@jalehman

jalehman commented Apr 9, 2026

Copy link
Copy Markdown
Contributor

Merged via squash.

Thanks @SnowSky1!

steipete pushed a commit that referenced this pull request Apr 10, 2026
…3506)

Merged via squash.

Prepared head SHA: a81e85d
Co-authored-by: SnowSky1 <126348592+SnowSky1@users.noreply.github.com>
Co-authored-by: jalehman <550978+jalehman@users.noreply.github.com>
Reviewed-by: @jalehman
lovewanwan pushed a commit to lovewanwan/openclaw that referenced this pull request Apr 28, 2026
…enclaw#63506)

Merged via squash.

Prepared head SHA: a81e85d
Co-authored-by: SnowSky1 <126348592+SnowSky1@users.noreply.github.com>
Co-authored-by: jalehman <550978+jalehman@users.noreply.github.com>
Reviewed-by: @jalehman
ogt-redknie pushed a commit to ogt-redknie/OPENX that referenced this pull request May 2, 2026
…enclaw#63506)

Merged via squash.

Prepared head SHA: a81e85d
Co-authored-by: SnowSky1 <126348592+SnowSky1@users.noreply.github.com>
Co-authored-by: jalehman <550978+jalehman@users.noreply.github.com>
Reviewed-by: @jalehman
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 9, 2026
…enclaw#63506)

Merged via squash.

Prepared head SHA: a81e85d
Co-authored-by: SnowSky1 <126348592+SnowSky1@users.noreply.github.com>
Co-authored-by: jalehman <550978+jalehman@users.noreply.github.com>
Reviewed-by: @jalehman
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 24, 2026
…enclaw#63506)

Merged via squash.

Prepared head SHA: a81e85d
Co-authored-by: SnowSky1 <126348592+SnowSky1@users.noreply.github.com>
Co-authored-by: jalehman <550978+jalehman@users.noreply.github.com>
Reviewed-by: @jalehman
jameslcowan pushed a commit to jameslcowan/openclaw that referenced this pull request Jun 2, 2026
…enclaw#63506)

Merged via squash.

Prepared head SHA: a81e85d
Co-authored-by: SnowSky1 <126348592+SnowSky1@users.noreply.github.com>
Co-authored-by: jalehman <550978+jalehman@users.noreply.github.com>
Reviewed-by: @jalehman
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: sessions_send A2A announce drops threadId on sessions.list fallback

2 participants