Skip to content

fix(active-memory): skip scoped topic channelId for embedded recall run in Telegram forum topics (#76704)#76719

Merged
Takhoffman merged 2 commits intoopenclaw:mainfrom
hclsys:fix/76704-active-memory-topic-channel-id
May 3, 2026
Merged

fix(active-memory): skip scoped topic channelId for embedded recall run in Telegram forum topics (#76704)#76719
Takhoffman merged 2 commits intoopenclaw:mainfrom
hclsys:fix/76704-active-memory-topic-channel-id

Conversation

@hclsys
Copy link
Copy Markdown
Contributor

@hclsys hclsys commented May 3, 2026

Fixes #76704.

Problem

Telegram forum-topic sessions encode the conversation identity as a scoped id in the channelId field:

sessionKey: "agent:main:telegram:group:-100123:topic:77"
channelId:  "-100123:topic:77"

resolveRecallRunChannelContext passed this value directly to runEmbeddedPiAgent as messageChannel. That value then reaches normalizeBundledPluginDirName, which throws:

Error: Bundled plugin dirName must be a single directory: -100123:topic:77

because : is not allowed in plugin directory names.

Fix

Introduce runnableExplicitChannel in resolveRecallRunChannelContext: any channelId containing : is a scoped conversation id, not a runnable channel name. The resolution chain falls back to messageProvider ("telegram") as messageChannel instead — the correct plugin directory name.

channelId "-100123:topic:77"  →  runnableExplicitChannel = undefined
messageProvider "telegram"    →  messageChannel = "telegram"  ✓

Test

Added a regression test in extensions/active-memory/index.test.ts:

uses messageProvider not topic channelId for embedded recall in Telegram forum topics (#76704)

Simulates a before_prompt_build hook call with channelId: "-100123:topic:77" and asserts runEmbeddedPiAgent receives messageChannel: "telegram".

All 102 tests pass.

@clawsweeper
Copy link
Copy Markdown
Contributor

clawsweeper Bot commented May 3, 2026

Codex review: needs changes before merge.

Summary
The PR updates Active Memory embedded recall channel resolution so Telegram forum-topic scoped conversation ids are not passed as runnable plugin channel names, with a regression test and changelog entry.

Reproducibility: yes. Source inspection gives a high-confidence path: Telegram topic sessions produce a colon-containing conversation id, current Active Memory can pass that id as messageChannel, and bundled plugin dir-name validation rejects ':'.

Next step before merge
A one-line changelog credit update is a safe mechanical follow-up; the functional code change is otherwise narrow and source-backed.

Security
Cleared: The diff only changes Active Memory resolution logic, its colocated test, and CHANGELOG.md; it adds no dependency, workflow, packaging, secret, or downloaded-code surface.

Review findings

  • [P3] Credit the contributor in the changelog entry — CHANGELOG.md:39
Review details

Best possible solution:

Keep the resolver fix and regression test, add the missing changelog credit, then merge once normal maintainer checks pass.

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

Yes. Source inspection gives a high-confidence path: Telegram topic sessions produce a colon-containing conversation id, current Active Memory can pass that id as messageChannel, and bundled plugin dir-name validation rejects ':'.

Is this the best way to solve the issue?

Yes. Resolving this inside Active Memory by ignoring scoped conversation ids for runnable channel selection and falling back to messageProvider is the narrow maintainable fix; the remaining cleanup is changelog credit only.

Full review comments:

  • [P3] Credit the contributor in the changelog entry — CHANGELOG.md:39
    OpenClaw changelog policy asks contributor-facing entries to include a human Thanks @... credit. This new user-facing fix entry currently has no credit despite known human contributors, so the release-note credit audit will need a follow-up.
    Confidence: 0.83

Overall correctness: patch is correct
Overall confidence: 0.86

Acceptance criteria:

  • pnpm test extensions/active-memory/index.test.ts
  • pnpm exec oxfmt --check --threads=1 extensions/active-memory/index.ts extensions/active-memory/index.test.ts
  • git diff --check

What I checked:

Likely related people:

  • steipete: Current checkout history and blame for the Active Memory resolver, hook channel context, Telegram topic parser, and bundled public-surface validation point to Peter Steinberger's recent commits across the relevant paths. (role: introduced behavior / adjacent maintainer; confidence: medium; commits: 8c95664e5596, 9e56cfcc3588, 103b6d50a5b6; files: extensions/active-memory/index.ts, src/plugins/hook-agent-context.ts, extensions/telegram/src/topic-conversation.ts)

Remaining risk / open question:

  • I did not run the new Active Memory test or observe CI in this read-only review.

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

@hclsys
Copy link
Copy Markdown
Contributor Author

hclsys commented May 3, 2026

Fixup pushed (SHA `38fcf6fa10`):

P3 — changelog entry: added single-line fix entry under Unreleased / Fixes in CHANGELOG.md covering the Telegram forum-topic dirName validation fix (#76704).

hclsys and others added 2 commits May 3, 2026 09:45
…nel in Telegram forum topics (openclaw#76704)

Telegram forum-topic sessions use a scoped conversation id (e.g.
"-100123:topic:77") as the channelId. Passing that value directly to
`runEmbeddedPiAgent` as `messageChannel` causes `normalizeBundledPluginDirName`
to throw because ":" is not allowed in plugin directory names.

Introduce `runnableExplicitChannel` in `resolveRecallRunChannelContext`: any
channelId containing ":" is treated as a scoped conversation id, not a runnable
channel name. The embedded recall run falls back to `messageProvider` ("telegram")
as its channel instead, which is the correct plugin directory name.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…annel fix (openclaw#76704)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Takhoffman Takhoffman force-pushed the fix/76704-active-memory-topic-channel-id branch from 38fcf6f to 7d3e1cc Compare May 3, 2026 15:08
@openclaw-barnacle openclaw-barnacle Bot added the r: too-many-prs Auto-close: author has more than twenty active PRs. label May 3, 2026
@openclaw-barnacle
Copy link
Copy Markdown

Closing this PR because the author has more than 20 active PRs in this repo. Please reduce the active PR queue and reopen or resubmit once it is back under the limit. You can close your own PRs to get back under the limit.

@openclaw-barnacle openclaw-barnacle Bot closed this May 3, 2026
@Takhoffman Takhoffman added bad-barnacle Suppress Barnacle automation on this issue or PR. and removed r: too-many-prs Auto-close: author has more than twenty active PRs. labels May 3, 2026
@Takhoffman Takhoffman reopened this May 3, 2026
@Takhoffman Takhoffman merged commit 081f873 into openclaw:main May 3, 2026
174 of 175 checks passed
@Takhoffman
Copy link
Copy Markdown
Contributor

Merged in 081f873 after representative verification with pnpm install --frozen-lockfile, the focused Active Memory Vitest file, targeted oxfmt, and git diff --check.

I rebased the PR onto latest main and kept the Active Memory changelog entry in Unreleased / Fixes while resolving the changelog conflict.

arieldiego73 pushed a commit to arieldiego73/openclaw that referenced this pull request May 5, 2026
…un in Telegram forum topics (openclaw#76704) (openclaw#76719)

Verified:
- pnpm install --frozen-lockfile
- pnpm test extensions/active-memory/index.test.ts
- pnpm exec oxfmt --check --threads=1 extensions/active-memory/index.ts extensions/active-memory/index.test.ts CHANGELOG.md
- git diff --check origin/main..HEAD

Co-authored-by: hclsys <7755017+hclsys@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
lxe pushed a commit to lxe/openclaw that referenced this pull request May 6, 2026
…un in Telegram forum topics (openclaw#76704) (openclaw#76719)

Verified:
- pnpm install --frozen-lockfile
- pnpm test extensions/active-memory/index.test.ts
- pnpm exec oxfmt --check --threads=1 extensions/active-memory/index.ts extensions/active-memory/index.test.ts CHANGELOG.md
- git diff --check origin/main..HEAD

Co-authored-by: hclsys <7755017+hclsys@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 9, 2026
…un in Telegram forum topics (openclaw#76704) (openclaw#76719)

Verified:
- pnpm install --frozen-lockfile
- pnpm test extensions/active-memory/index.test.ts
- pnpm exec oxfmt --check --threads=1 extensions/active-memory/index.ts extensions/active-memory/index.test.ts CHANGELOG.md
- git diff --check origin/main..HEAD

Co-authored-by: hclsys <7755017+hclsys@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bad-barnacle Suppress Barnacle automation on this issue or PR. size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: active-memory fails in Telegram forum topic sessions with directory-name validation error

2 participants