Skip to content

feat(telegram): bind spawned subagents to forum topics#82023

Open
efpiva wants to merge 12 commits into
openclaw:mainfrom
efpiva:codeclaw-telegram-thread-binding
Open

feat(telegram): bind spawned subagents to forum topics#82023
efpiva wants to merge 12 commits into
openclaw:mainfrom
efpiva:codeclaw-telegram-thread-binding

Conversation

@efpiva

@efpiva efpiva commented May 15, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds an explicit supportsAutomaticThreadBindingSpawn channel capability so automatic thread-bound session spawn support is not overloaded onto defaultTopLevelPlacement.
  • Wires Telegram subagent_spawning, subagent_delivery_target, and subagent_ended hooks so sessions_spawn(thread:true) for subagents can create and bind a child forum topic while keeping Telegram's normal top-level binding placement as current.
  • Makes the spawn capability per-kind (subagent vs acp) so Telegram advertises subagent forum-topic spawn support without incorrectly exposing ACP child-topic spawn.
  • Documents the new capability seam and adds Telegram/core regression coverage for schema exposure, runtime capabilities, hook registration, binding, completion routing, cleanup, and boundary invariants.

Context

Telegram already had forum-topic primitives and session binding infrastructure, but it lacked the subagent lifecycle hook wiring and an explicit capability to say: "explicit subagent thread spawns can create child topics, while ordinary top-level binding should stay in the current conversation." Discord and Matrix naturally expose automatic thread spawns through defaultTopLevelPlacement: "child"; Feishu keeps current placement and does not advertise child-thread session spawn. Telegram now follows the narrower model: keep normal Telegram /focus and top-level binding behavior current, while allowing explicit sessions_spawn(thread:true) for subagents to create a child forum topic when the Telegram adapter can do so.

Real behavior proof

  • Behavior or issue addressed: Telegram sessions_spawn(thread:true, mode:"session") from a channel-bound CodeClaw triage session creates and binds a real Telegram forum topic for the spawned subagent session, so follow-up work routes to that topic instead of becoming invisible or falling back to the parent topic.

  • Real environment tested: Live codeclaw-triage Docker container after installing a custom OpenClaw package built from combined proof branch codeclaw-proof-82023-82275 (https://github.com/efpiva/openclaw/tree/codeclaw-proof-82023-82275) at OpenClaw 2026.5.17 (db1c53a). The container was connected to the real CodeClaw Telegram forum supergroup and used the real CodeClaw triage cron job.

  • Exact steps or command run after this patch:

    docker exec --user codeclaw codeclaw-triage     HOME=/home/codeclaw openclaw cron run cc373f35-b483-4c7f-9253-2f6c9c94a595       --wait --wait-timeout 15m --timeout 30000
  • Evidence after fix:

    The triage transcript for run 1d6d77dd-c23b-4b02-9831-e990fb11a7fc shows the initial PR action for private CodeClaw PR [Bug]: Windows install script HOME variable error #1223 was spawned with thread:true and mode:"session":

    {
      "type": "toolCall",
      "name": "sessions_spawn",
      "arguments": {
        "agentId": "main",
        "label": "codeclaw-pr:external:microsoft.ghe.com:bic/lobster:1223",
        "mode": "session",
        "context": "isolated",
        "thread": true
      }
    }

    The tool result accepted the spawn and returned a thread-bound child session:

    {
      "toolName": "sessions_spawn",
      "isError": false,
      "details": {
        "status": "accepted",
        "childSessionKey": "agent:main:subagent:c89515e3-1a1e-4465-8fe9-8b25e85c7819",
        "runId": "23538111-3540-4645-a66b-cc0568f96de0",
        "mode": "session",
        "note": "thread-bound session stays active after this task; continue in-thread for follow-ups.",
        "modelApplied": true
      }
    }

    Live Telegram/OpenClaw logs show the forum topic was created and bound to that child session. The Telegram supergroup id is redacted, but the topic id and session key are unchanged:

    2026-05-17T15:07:57.282-07:00 telegram: bound conversation <telegram-supergroup-id>:topic:1167 -> agent:main:subagent:c89515e3-1a1e-4465-8fe9-8b25e85c7819 (idle=24h maxAge=disabled)
    2026-05-17T15:07:57.406-07:00 [telegram] update: {"message":{"message_id":1167,"chat":{"title":"CodeClaw Activity","is_forum":true,"type":"supergroup"},"message_thread_id":1167,"forum_topic_created":{"name":"🤖 codeclaw-pr:external:microsoft.ghe.com:bic/lobster:1223"},"is_topic_message":true}}
    2026-05-17T15:07:57.923-07:00 [agent/embedded] embedded run start: runId=23538111-3540-4645-a66b-cc0568f96de0 sessionId=ada5b4d0-65b5-48ff-8c81-76c2ab477ab8 provider=github-copilot model=gpt-5.5 thinking=medium messageChannel=telegram
    2026-05-17T15:07:58.444-07:00 [agent/embedded] [context-diag] pre-prompt: sessionKey=agent:main:subagent:c89515e3-1a1e-4465-8fe9-8b25e85c7819 ... sessionFile=/home/codeclaw/.openclaw/agents/main/sessions/ada5b4d0-65b5-48ff-8c81-76c2ab477ab8-topic-1167.jsonl
    

    The persisted Telegram binding file contains the same mapping:

    {
      "conversationId": "<telegram-supergroup-id>:topic:1167",
      "targetKind": "subagent",
      "targetSessionKey": "agent:main:subagent:c89515e3-1a1e-4465-8fe9-8b25e85c7819",
      "agentId": "main",
      "label": "codeclaw-pr:external:microsoft.ghe.com:bic/lobster:1223",
      "metadata": {
        "threadName": "🤖 codeclaw-pr:external:microsoft.ghe.com:bic/lobster:1223"
      }
    }

    The CodeClaw poller state also persisted the spawned native session key for that PR:

    {
      "source": "pr_reviews",
      "id": "microsoft.ghe.com|bic/lobster#1223",
      "lastKind": "initial",
      "nativeSessionKey": "agent:main:subagent:c89515e3-1a1e-4465-8fe9-8b25e85c7819"
    }
  • Observed result after fix: The live Telegram Bot API created forum topic 1167, OpenClaw bound it to the spawned main subagent session, the child session ran with messageChannel=telegram, and all child/specialist session transcript files for the spawned review used the topic-1167 suffix. CodeClaw recorded nativeSessionKey for future follow-ups.

  • What was not tested: Telegram permission-denied and non-forum failure paths in the live container; those remain covered by local mocked tests. The live proof used one real forum supergroup and one real CodeClaw triage run.

Supplemental validation

Behavior addressed: Telegram subagent sessions_spawn(thread:true) now has an explicit per-kind automatic-spawn capability and lifecycle hooks that bind spawned subagents to child forum topics without enabling Telegram ACP child-topic spawns.

Real environment tested: Local OpenClaw source checkout with mocked Telegram forum topic creation and session binding adapters; no live Telegram Bot API/forum supergroup was used.

Exact steps or command run after this patch:

node scripts/run-vitest.mjs \
  extensions/telegram/src/subagent-hooks.test.ts \
  extensions/telegram/index.test.ts \
  extensions/telegram/src/thread-bindings.test.ts \
  src/channels/plugins/thread-binding-api.test.ts \
  src/channels/thread-bindings-policy.test.ts \
  src/agents/runtime-capabilities.test.ts \
  src/agents/tools/sessions-spawn-tool.test.ts \
  src/agents/acp-spawn.test.ts \
  src/plugins/contracts/boundary-invariants.test.ts
pnpm docs:check-mdx docs/plugins/sdk-channel-plugins.md
git diff --check
pnpm build
codex review --uncommitted

Evidence after fix: Targeted Vitest proof passed with 12 files and 245 tests; docs MDX check passed; whitespace check passed; pnpm build completed including plugin SDK export verification; final Codex CLI review reported no actionable correctness issues.

Observed result after fix: Telegram advertises thread for subagent session spawn through the new explicit per-kind capability, returns a routable Telegram delivery origin for created forum topics, routes completion to the bound topic, cleans up Telegram subagent bindings, and does not advertise/recommend ACP thread-bound spawns when ACP support is disabled for Telegram.

What was not tested: Live Telegram Bot API behavior in a real forum supergroup with can_manage_topics; non-forum group and permission failure behavior were covered only through local unit paths/mocked failures.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: telegram Channel integration: telegram agents Agent runtime and tooling size: L triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels May 15, 2026
@clawsweeper

clawsweeper Bot commented May 15, 2026

Copy link
Copy Markdown
Contributor

Codex review: found issues before merge. Reviewed June 30, 2026, 8:23 PM ET / July 1, 2026, 00:23 UTC.

Summary
Adds Telegram thread-bound subagent forum-topic spawning, per-kind thread-spawn capability exposure, topic progress mirroring, docs, prompt snapshots, and regression tests.

PR surface: Source +1134, Tests +854, Docs +13. Total +2001 across 33 files.

Reproducibility: yes. source-level. Current main keeps Telegram as current placement while sessions_spawn only exposes thread/session fields when automatic child-thread spawn is supported, so the requested Telegram child-topic subagent path remains unavailable.

Review metrics: 3 noteworthy metrics.

  • Plugin/channel capability surface: 1 added. supportsAutomaticThreadBindingSpawn becomes a plugin-facing compatibility contract that maintainers should accept before merge.
  • Deprecated routing hook registrations: 1 added. The branch registers new routing behavior on subagent_spawning after current main deprecated that hook for new routing.
  • Core Telegram runtime coupling: 1 new core caller. Gateway core would directly call Telegram runtime edit/delete helpers, which matters for plugin ownership and packaging boundaries.

Stored data model
Persistent data-model change detected: serialized state: src/agents/tools/sessions-spawn-tool.test.ts, unknown-data-model-change: src/agents/tools/sessions-spawn-tool.test.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #42986
Summary: This PR is a proof-backed implementation candidate for the canonical Telegram child-topic subagent spawn request, while the merged core refactor and the safety PR only partially overlap.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🧂 unranked krab
Proof: 🦞 diamond lobster
Patch quality: 🧂 unranked krab
Result: blocked by patch quality or review findings.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Rebase against current main and resolve the core session-binding direction.
  • Move Telegram progress mirroring behind an accepted channel/plugin seam or remove it from gateway core.
  • Gate commentary and thinking topic previews with the existing commentary visibility policy.

Mantis proof suggestion
A native Telegram Desktop recording would directly show forum-topic creation, edited progress preview behavior, and final delivery on the rebased final head. A maintainer can ask Mantis to capture proof by posting this exact PR comment:

@openclaw-mantis telegram desktop proof: verify thread=true subagent spawn creates a forum topic, binds follow-up output there, edits one progress preview, and final delivery stays in topic after rebase.

Risk before merge

  • [P1] The branch adds a plugin-facing capability and routes new binding behavior through deprecated subagent_spawning, so maintainers need an explicit SDK/API decision before merge.
  • [P1] Gateway core directly owns Telegram progress preview send/edit/delete behavior, which can drift from Telegram plugin transport policy and packaging boundaries.
  • [P1] The topic mirror can expose assistant commentary or thinking text in Telegram forum topics without the existing streaming.progress.commentary opt-in.
  • [P1] The live proof is strong, but any rebase or ownership rewrite needs final-head Telegram proof because this PR touches visible topic creation, progress, and delivery behavior.

Maintainer options:

  1. Rework ownership and visibility before merge (recommended)
    Move Telegram-specific mirroring out of gateway core or behind an accepted generic seam, avoid new primary routing through subagent_spawning, honor commentary visibility, then rebase and revalidate.
  2. Accept the new capability direction explicitly
    Maintainers can choose to ship the per-kind capability and topic-progress behavior, but should record that as an intentional plugin API and Telegram visibility decision with final-head proof.
  3. Pause for channel capability design
    If supportsAutomaticThreadBindingSpawn is not the desired SDK seam, pause this branch and keep the canonical Telegram issue open for a replacement design.

Next step before merge

  • [P2] Needs human maintainer API, owner-boundary, security-visibility, and rebase decisions; the remaining work is not a single safe automated repair.

Security
Needs attention: Needs attention because the new Telegram topic mirror can expose assistant commentary or thinking text that existing channel policy hides by default.

Review findings

  • [P1] Move Telegram mirroring behind a channel seam — src/gateway/agent-event-channel-mirror.ts:83-89
  • [P1] Honor commentary visibility in topic mirrors — src/gateway/agent-event-channel-mirror.ts:229-239
  • [P1] Use the core binding path instead of subagent_spawning — extensions/telegram/subagent-hooks-api.ts:13-16
Review details

Best possible solution:

Land a rebased, narrower version that exposes Telegram subagent child-topic spawning through an accepted core session-binding adapter capability, keeps Telegram transport behavior plugin-owned or behind a generic channel seam, preserves commentary visibility policy, and refreshes live Telegram proof on the final head.

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

Yes, source-level. Current main keeps Telegram as current placement while sessions_spawn only exposes thread/session fields when automatic child-thread spawn is supported, so the requested Telegram child-topic subagent path remains unavailable.

Is this the best way to solve the issue?

No, not as submitted. The product goal is valid, but the maintainable path is a rebased core session-binding adapter capability plus plugin-owned or generic mirroring and an explicit commentary visibility gate.

Full review comments:

  • [P1] Move Telegram mirroring behind a channel seam — src/gateway/agent-event-channel-mirror.ts:83-89
    The new gateway mirror imports the Telegram runtime API and owns Telegram edit/delete preview behavior from src/gateway. Core should stay plugin-agnostic here; this should move behind an accepted channel/plugin seam so Telegram-owned transport policy and packaging do not drift.
    Confidence: 0.84
  • [P1] Honor commentary visibility in topic mirrors — src/gateway/agent-event-channel-mirror.ts:229-239
    This mirror sends non-final assistant commentary and thinking events into Telegram topic previews whenever tool-progress mirroring is enabled, but existing channel streaming policy hides commentary unless streaming.progress.commentary is explicitly enabled. Group topics can therefore receive text the current policy treats as hidden.
    Confidence: 0.88
  • [P1] Use the core binding path instead of subagent_spawning — extensions/telegram/subagent-hooks-api.ts:13-16
    Current main documents subagent_spawning as deprecated because core prepares thread:true bindings through session-binding adapters. Registering a new Telegram routing binder on this hook duplicates the adapter path and ties the feature to a compatibility hook with a removal path.
    Confidence: 0.82

Overall correctness: patch is incorrect
Overall confidence: 0.88

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 5e572dcf781a.

Label changes

Label justifications:

  • P2: This is a normal-priority Telegram agent/channel workflow improvement with bounded but real routing and delivery impact.
  • merge-risk: 🚨 compatibility: The PR adds a plugin/channel capability contract and uses a deprecated routing hook, both of which affect plugin API and upgrade expectations.
  • merge-risk: 🚨 message-delivery: The PR changes Telegram subagent spawn, progress, completion, and cron-run routing into forum topics.
  • merge-risk: 🚨 security-boundary: The new mirror can expose assistant commentary or thinking text in Telegram topics without the existing commentary visibility gate.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🦞 diamond lobster and patch quality is 🧂 unranked krab.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (logs): Redacted live logs in the PR body and comments show after-fix Telegram topic creation, binding, progress preview edits, and final delivery; final-head proof is still needed if the implementation is rebased or reworked.
  • proof: sufficient: Contributor real behavior proof is sufficient. Redacted live logs in the PR body and comments show after-fix Telegram topic creation, binding, progress preview edits, and final delivery; final-head proof is still needed if the implementation is rebased or reworked.
  • mantis: telegram-visible-proof: Mantis should capture Telegram visible proof. The PR changes visible Telegram forum-topic creation, progress preview edits, and final delivery behavior that can be demonstrated in a short Telegram Desktop proof.
Evidence reviewed

PR surface:

Source +1134, Tests +854, Docs +13. Total +2001 across 33 files.

View PR surface stats
Area Files Added Removed Net
Source 17 1147 13 +1134
Tests 14 870 16 +854
Docs 2 13 0 +13
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 33 2030 29 +2001

Security concerns:

  • [medium] Topic mirror bypasses commentary visibility — src/gateway/agent-event-channel-mirror.ts:229
    The mirror formats assistant commentary and thinking events for Telegram progress previews without checking streaming.progress.commentary, so group topics may receive text that current channel policy treats as hidden unless explicitly enabled.
    Confidence: 0.88

What I checked:

  • Repository policy read and applied: Root and scoped AGENTS guidance required full-surface review, plugin/core boundary checks, compatibility risk treatment, and Telegram-specific proof review. (AGENTS.md:29, 5e572dcf781a)
  • Telegram maintainer notes applied: Telegram notes say streaming owns one visible preview message, Telegram API behavior should stay Telegram-owned, group/channel visible replies are policy-controlled, and Telegram behavior PRs need real Telegram proof. (.agents/maintainer-notes/telegram.md:9, 5e572dcf781a)
  • Current main still lacks Telegram automatic child-topic spawn exposure: Current main only exposes session/thread spawn fields when supportsAutomaticThreadBindingSpawn(channel) is true, while Telegram's top-level placement remains current. (src/agents/tools/sessions-spawn-tool.ts:144, 5e572dcf781a)
  • Telegram has child-topic binding primitives on main: The Telegram session-binding adapter on current main supports current and child placements and creates forum topics for child placement, so the remaining gap is exposure/routing, not missing Telegram topic infrastructure. (extensions/telegram/src/thread-bindings.ts:707, 5e572dcf781a)
  • Deprecated hook contract on main: Current docs and hook types mark subagent_spawning as deprecated because core now prepares thread:true subagent bindings through session-binding adapters before subagent_spawned. Public docs: docs/plugins/hooks.md. (docs/plugins/hooks.md:145, 5e572dcf781a)
  • PR reintroduces routing through deprecated hook: The branch registers Telegram subagent_spawning and returns routing behavior through that compatibility hook instead of the current core binding path. (extensions/telegram/subagent-hooks-api.ts:13, 987388309d68)

Likely related people:

  • steipete: Authored the merged core SessionBindingService refactor that moved native thread:true subagent binding into core and deprecated subagent_spawning routing. (role: core thread-binding refactor author; confidence: high; commits: 3fc0df953cf1, 8612af754b4d; files: src/agents/subagent-spawn.ts, src/channels/thread-bindings-policy.ts, docs/plugins/hooks.md)
  • vincentkoc: Recent current-main history touches Telegram runtime loading, channel progress state, and subagent completion delivery paths adjacent to this PR's routing and progress-preview behavior. (role: recent channel and subagent delivery contributor; confidence: medium; commits: e012f2cd3cc8, e114001ccafa, 68a1e00b73bd; files: extensions/telegram/src/thread-bindings.ts, src/channels/streaming.ts, src/agents/subagent-announce-delivery.ts)
  • obviyus: Recent merged Telegram rich/progress transport work is adjacent to the PR's visible Telegram topic output and security-visibility questions. (role: recent Telegram transport contributor; confidence: medium; commits: da92615816b6, 42dcf7075f2d, 56baf9d07963; files: extensions/telegram/src/channel.ts, src/channels/streaming.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@clawsweeper clawsweeper Bot added the mantis: telegram-visible-proof Mantis should capture Telegram visible proof. label May 15, 2026
@efpiva

efpiva commented May 15, 2026

Copy link
Copy Markdown
Contributor Author

Follow-up after the gate review:

  • Fixed the prompt:snapshots:check drift in a4498e8 by regenerating the Telegram prompt snapshots with pnpm prompt:snapshots:gen.
  • Verified locally after the commit:
    • pnpm prompt:snapshots:checkPrompt snapshots are current (7 files).
    • git diff --check → no output.
  • The rerun CI shards that were downstream of snapshot drift are now green, including check-additional-boundaries-a, check-additional, checks-node-core-support-boundary, and checks-node-core.

Remaining blocker: Real behavior proof is still red. I attempted to produce live Telegram proof via the project Telegram credential lease path, but this environment does not have OPENCLAW_QA_CONVEX_SITE_URL / the Convex credential env available. I also attempted to apply the documented proof: override label, but this fork author account lacks label permissions on openclaw/openclaw (AddLabelsToLabelable denied). A maintainer will need to either run/attach the live Telegram forum proof or apply proof: override if the mocked/unit proof is sufficient for this PR.

@openclaw-barnacle openclaw-barnacle Bot added proof: supplied External PR includes structured after-fix real behavior proof. and removed triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels May 17, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. P2 Normal backlog priority with limited blast radius. impact:message-loss Channel message delivery can be lost, duplicated, or misrouted. impact:session-state Session, memory, transcript, context, or agent state can drift or corrupt. labels May 17, 2026
@efpiva

efpiva commented May 17, 2026

Copy link
Copy Markdown
Contributor Author

Follow-up live proof for commit c807f9ea50 / proof build 487cbca:

Real behavior proof addendum

  • Behavior addressed: nested specialist completion announces into a thread-bound PR/subagent session now route visible assistant output to the bound Telegram topic automatically. CodeClaw should not need to use the native message tool explicitly for the PR-topic digest when the session is correctly thread-bound.
  • Real environment tested: live codeclaw-triage container rebuilt from the local OpenClaw tarball at OpenClaw 2026.5.17 (487cbca), connected to the real CodeClaw Telegram forum supergroup.
  • Exact steps or command run after this patch: created a real Telegram proof forum topic (thread_id=1187), then ran a Gateway agent turn for synthetic thread-bound requester session agent:main:subagent:proof-20260517t230715z; the parent called sessions_spawn for a generalist child, the child replied CHILD_COMPLETION_PROOF_proof-20260517T230715Z, and the nested completion announce resumed the parent session.
  • Evidence after fix: docker logs show the completion announce run announce:v1:agent:generalist:subagent:9cb8f0bb-909d-4940-88ad-1582d02f1148:8dd3a6d6-25df-4a16-8188-5b5cfe25660b started with messageChannel=telegram for the parent thread-bound session, then emitted PARENT_TOPIC_DELIVERY_PROOF_proof-20260517T230715Z, followed by [telegram] outbound send ok ... messageId=1188 ... threadId=1187.
  • Observed result after fix: the visible parent completion output was delivered to the real Telegram topic 1187 automatically through OpenClaw's thread-bound session delivery path.
  • What was not tested: a full new CodeClaw PR review tick was not run after this patch because CodeClaw cron was intentionally stopped for debugging. The live proof used a synthetic thread-bound subagent session to exercise the same nested completion delivery path that failed for CodeClaw PR topics.

Evidence bundle path in the live proof environment: /tmp/openclaw-pr-evidence/82023-followup/.

@openclaw-barnacle openclaw-barnacle Bot added the gateway Gateway runtime label May 18, 2026
@efpiva

efpiva commented May 18, 2026

Copy link
Copy Markdown
Contributor Author

Follow-up streaming proof for latest branch head 89bfbe3643 / proof build e807b53:

Real behavior proof addendum — topic transcript parity

  • Behavior addressed: PR-topic Telegram output was still not transcript-equivalent: the topic showed only the final summary, while the session JSONL contained assistant progress, tool calls, and tool results. The follow-up commits add a channel mirror for thread-bound sessions plus cron delivery-context/run-context plumbing so Telegram topics receive progress/tool-output events, not just final answers.
  • Runtime tested: live codeclaw-triage rebuilt with OpenClaw 2026.5.17 (e807b53).
  • Real topic tested: existing CodeClaw Telegram PR topic 1189 for bic/lobster#1231.
  • Scheduled proof run: one-shot OpenClaw cron job f89632b0-8d30-4d9f-8bbc-865aae54ffaa, status ok, duration 13984ms; this was a scheduled cron run, not a manual gateway call.
  • Session transcript evidence: /home/codeclaw/.openclaw/agents/main/sessions/0cba4728-2e4c-4e33-9de5-5677832c02ea.jsonl contains:
    • line 5: OPENCLAW_STREAM_MIRROR_PROOF_E807B53 prompt for topic 1189
    • line 6: assistant commentary STREAM_PROOF_ASSISTANT_PROGRESS_005419 plus exec tool call printf STREAM_PROOF_TOOL_OUTPUT_005419
    • line 7: tool result STREAM_PROOF_TOOL_OUTPUT_005419, exitCode: 0
    • line 8: final answer STREAM_PROOF_FINAL_005419
  • Telegram delivery evidence: docker outbound logs show ten real Telegram sends to chat -1003898998425 with threadId=1189 during/after that scheduled run: message IDs 1204 through 1213.
  • Observed result after fix: unlike the earlier bic/lobster#1231 run that delivered only the final summary, the same real topic now receives multiple progress/tool/final messages for the run, matching the session transcript markers rather than only the final assistant answer.
  • Cleanup: proof cron jobs were removed; CodeClaw triage and own-PR health crons remain disabled; the temporary forced pr-tracker signature for bic/lobster#1231 was restored to f0d57602da599dac92e48cf4ba1b65ede3e49a83.

Evidence bundle path in the live proof environment: /tmp/openclaw-pr-evidence/82023-stream/.

@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. and removed impact:message-loss Channel message delivery can be lost, duplicated, or misrouted. labels Jun 2, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Jun 14, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the stale Marked as stale due to inactivity label Jun 15, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Jun 15, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. mantis: telegram-visible-proof Mantis should capture Telegram visible proof. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. mantis: telegram-visible-proof Mantis should capture Telegram visible proof. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Jun 21, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Jun 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling channel: telegram Channel integration: telegram docs Improvements or additions to documentation gateway Gateway runtime mantis: telegram-visible-proof Mantis should capture Telegram visible proof. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: supplied External PR includes structured after-fix real behavior proof. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: XL status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant