Skip to content

fix(telegram): expose live location updates to hooks - #122185

Merged
mbelinky merged 10 commits into
mainfrom
codex/telegram-live-location-20260811
Aug 11, 2026
Merged

mbelinky merged 10 commits into
mainfrom
codex/telegram-live-location-20260811

Conversation

@mbelinky

Copy link
Copy Markdown
Contributor

Summary

  • expose normalized location data and stable provider update identity on inbound message hooks
  • emit authorized Telegram live-location edits through message_received without starting an agent turn
  • preserve Telegram update identity and lifecycle timestamps through synthetic message contexts

Why

Telegram delivers live-location movement as edited messages. Those edits were cached for replies but were invisible to plugin observers, while the normal inbound mapper also discarded structured location and update identity. Plugins could therefore observe the initial point but not reliably track later movement.

Validation

  • pnpm tsgo:prod
  • node scripts/run-vitest.mjs extensions/telegram/src/location-message-hook.test.ts src/hooks/message-hook-mappers.test.ts (31 tests)
  • focused Telegram end-to-end location case (1 passed, 14 skipped)
  • changed-file formatting and git diff --check
  • private bounded autoreview on the final rebased patch: clean

Release note

Telegram live-location edits are now observable through the normal plugin message hook without waking the agent. This touches the Plugin SDK message-hook seam and is suitable for inclusion in the active release line.

@clawsweeper

clawsweeper Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: telegram Channel integration: telegram size: M maintainer Maintainer-authored PR scripts Repository scripts labels Aug 11, 2026
@mbelinky
mbelinky force-pushed the codex/telegram-live-location-20260811 branch from 4304a15 to b37bbab Compare August 11, 2026 18:43
@clawsweeper clawsweeper Bot added merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 11, 2026
@clawsweeper

clawsweeper Bot commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 11, 2026, 5:05 PM ET / 21:05 UTC.

ClawSweeper review

What this changes

The PR adds normalized location and provider-update data to plugin message hooks and sends authorized Telegram live-location edits to observers without starting an agent turn.

Merge readiness

⚠️ Ready for maintainer review - 4 items remain

Keep this protected PR open for a clean rebase and real Telegram behavior proof. The prior channel-post and nonblocking-dispatch findings are addressed on the current head; no new code correctness defect was found.

Priority: P2
Reviewed head: c83a53ccede4d3d1284f39ca7580eb50ee67dd15

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) PR readiness rating was derived from proof quality, review findings, security review, and reviewer confidence.
Proof confidence 🌊 off-meta tidepool Not applicable: Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: Real behavior proof is not required for maintainer- or bot-authored pull requests.
Evidence reviewed 7 items Prior findings addressed: The PR head passes both edited-message and edited-channel-post update IDs into the observer helper after authorization and reply-chain recording, resolving the prior one-sided channel-post gap.
Established nonblocking boundary: The new helper uses the same fire-and-forget message-hook boundary used by normal accepted inbound turns, so observer work does not await before Telegram handling returns.
Typed SDK mapping: Location and provider-update facts are optional, cloned into both inbound-claim and message-received events, and exported through the public Plugin SDK entrypoint.
Findings None None.
Security None None.

How this fits together

Telegram inbound updates are authorized and normalized before either agent dispatch or plugin observation. This change adds an observer-only route for edited live locations while preserving normal agent-turn behavior.

flowchart LR
A[Telegram update] --> B[Inbound authorization]
B --> C{Edited live location}
C -->|yes| D[Nonblocking message hook]
C -->|no| E[Normal inbound dispatch]
D --> F[Plugin observers]
E --> G[Agent turn]
Loading

Before merge

  • Resolve merge risk (P1) - GitHub reports the current head as conflicting with main, so the exact merged result still needs a rebase and fresh exact-head checks.
  • Resolve merge risk (P1) - The SDK expansion is additive but public to third-party plugins; its behavior and the grammY Update type dependency need confirmation on the rebased head.
  • Resolve merge risk (P1) - The PR body supplies mocked test claims, not a redacted real Telegram update-to-hook trace required by the Telegram review guide.
  • Complete next step (P2) - Resolve the reported merge conflict and provide real Telegram proof; no narrow automated code repair is indicated.
Agent review details

Security

None.

PR surface

Source +234, Tests +225, Docs +2, Generated 0, Other +1. Total +462 across 48 files.

View PR surface stats
Area Files Added Removed Net
Source 10 240 6 +234
Tests 3 225 0 +225
Docs 2 3 1 +2
Config 0 0 0 0
Generated 32 32 32 0
Other 1 2 1 +1
Total 48 502 40 +462

Review metrics

Metric Value Why it matters
Production vs test LOC production +242/-5; tests +225; docs +2/-1; generated API baselines 33 hash updates The production growth implements a new observer path and public hook facts; focused tests cover the mapper and Telegram helper but do not replace live-channel proof.
Plugin hook contract 2 public types added; 2 inbound event shapes extended with optional fields This is additive but reaches third-party plugins, making upgrade behavior worth checking after rebase.

Stored data model

Persistent data-model change detected: vector/embedding metadata: docs/plugins/hooks.md. Confirm migration or upgrade compatibility proof before merge.

Mantis proof suggestion

A Telegram Desktop recording can directly verify the changed live-location observer flow and absence of agent dispatch. A maintainer can ask Mantis to capture proof by posting this exact PR comment:

@openclaw-mantis telegram desktop proof: verify that an edited live location reaches the message hook without starting an agent turn.

Merge-risk options

Maintainer options:

  1. Rebase and prove the live path (recommended)
    Resolve the main conflict, rerun exact-head checks, and add redacted Telegram evidence that the edited update reaches the hook without an agent turn.
  2. Accept the additive SDK surface
    A maintainer may explicitly accept the optional public fields after confirming downstream plugins tolerate the expanded event shape.

Technical review

Best possible solution:

Keep the channel-neutral optional hook contract, then rebase cleanly and attach a redacted Telegram trace or recording that shows an edited live location reaching a plugin hook without creating an agent turn.

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

Yes, from source: the base edited-update path only recorded reply-chain context, while the PR head emits an authorized edited-location observer event. A live Telegram reproduction was not supplied.

Is this the best way to solve the issue?

Yes, subject to rebase and live proof: the channel-owned emitter records provider facts at the Telegram boundary and reuses the canonical hook mapper rather than sending edits through agent dispatch.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🌊 off-meta tidepool and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: Real behavior proof is not required for maintainer- or bot-authored pull requests.
  • add mantis: telegram-visible-proof: Mantis should capture Telegram visible proof. An edited live-location update and the absence of an agent reply are directly demonstrable in Telegram Desktop.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🦞 diamond lobster, so this older rating label is no longer current.
  • remove merge-risk: 🚨 availability: Current PR review merge-risk labels are merge-risk: 🚨 compatibility.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: The PR changes a bounded Telegram-to-plugin observation flow without evidence of a broader outage.
  • merge-risk: 🚨 compatibility: It expands public Plugin SDK inbound event data and changes the typed Telegram update projection used by existing plugins.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🌊 off-meta tidepool and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: Real behavior proof is not required for maintainer- or bot-authored pull requests.
  • mantis: telegram-visible-proof: Mantis should capture Telegram visible proof. An edited live-location update and the absence of an agent reply are directly demonstrable in Telegram Desktop.

Evidence

What I checked:

Likely related people:

  • obviyus: Authored the handler consolidation that established the edited-message and edited-channel-post routing now extended by this PR. (role: recent Telegram inbound-pipeline contributor; confidence: high; commits: d2825c70a516; files: extensions/telegram/src/bot-handlers.inbound-pipeline.ts)
  • steipete: Has the strongest sampled history on the shared hook mapper and plugin hook type surfaces, including the inbound-normalization refactor. (role: recent hook-surface contributor; confidence: high; commits: 0dd9dcda2ff4, 7eb9fa3389c3; files: src/hooks/message-hook-mappers.ts, src/plugins/hook-message.types.ts)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • 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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-08-11T20:10:58.461Z sha b37bbab :: found issues before merge. :: [P2] Emit channel-post live-location edits | [P2] Keep observer hooks off the inbound update critical path

mbelinky and others added 3 commits August 11, 2026 22:18
# Conflicts:
#	docs/.generated/plugin-sdk-api-baseline/agent-harness-runtime.json
#	docs/.generated/plugin-sdk-api-baseline/agent-harness.json
#	docs/.generated/plugin-sdk-api-baseline/agent-runtime.json
#	docs/.generated/plugin-sdk-api-baseline/channel-core.json
#	docs/.generated/plugin-sdk-api-baseline/channel-entry-contract.json
#	docs/.generated/plugin-sdk-api-baseline/channel-inbound.json
#	docs/.generated/plugin-sdk-api-baseline/channel-message.json
#	docs/.generated/plugin-sdk-api-baseline/channel-outbound.json
#	docs/.generated/plugin-sdk-api-baseline/channel-pairing.json
#	docs/.generated/plugin-sdk-api-baseline/channel-plugin-common.json
#	docs/.generated/plugin-sdk-api-baseline/core.json
#	docs/.generated/plugin-sdk-api-baseline/discord.json
#	docs/.generated/plugin-sdk-api-baseline/inbound-reply-dispatch.json
#	docs/.generated/plugin-sdk-api-baseline/meeting-runtime.json
#	docs/.generated/plugin-sdk-api-baseline/plugin-entry.json
#	docs/.generated/plugin-sdk-api-baseline/plugin-runtime.json
#	docs/.generated/plugin-sdk-api-baseline/provider-catalog-runtime.json
#	docs/.generated/plugin-sdk-api-baseline/runtime-store.json
#	docs/.generated/plugin-sdk-api-baseline/session-catalog.json
#	docs/.generated/plugin-sdk-api-baseline/tool-plugin.json
#	docs/.generated/plugin-sdk-api-baseline/webhook-ingress.json
# Conflicts:
#	docs/.generated/plugin-sdk-api-baseline/agent-harness-runtime.json
#	docs/.generated/plugin-sdk-api-baseline/agent-harness.json
#	docs/.generated/plugin-sdk-api-baseline/channel-core.json
#	docs/.generated/plugin-sdk-api-baseline/channel-entry-contract.json
#	docs/.generated/plugin-sdk-api-baseline/channel-message.json
#	docs/.generated/plugin-sdk-api-baseline/channel-outbound.json
#	docs/.generated/plugin-sdk-api-baseline/channel-plugin-common.json
#	docs/.generated/plugin-sdk-api-baseline/command-auth-native.json
#	docs/.generated/plugin-sdk-api-baseline/core.json
#	docs/.generated/plugin-sdk-api-baseline/discord.json
#	docs/.generated/plugin-sdk-api-baseline/inbound-reply-dispatch.json
#	docs/.generated/plugin-sdk-api-baseline/meeting-runtime.json
#	docs/.generated/plugin-sdk-api-baseline/plugin-entry.json
#	docs/.generated/plugin-sdk-api-baseline/plugin-runtime.json
#	docs/.generated/plugin-sdk-api-baseline/provider-catalog-runtime.json
#	docs/.generated/plugin-sdk-api-baseline/tool-plugin.json
#	docs/.generated/plugin-sdk-api-baseline/webhook-ingress.json
@mbelinky

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@mbelinky

Copy link
Copy Markdown
Contributor Author

Maintainer decision: approve the additive channel-neutral location and providerUpdate fields. They are producer-owned event facts needed by downstream plugins. The current head covers both edited_message and edited_channel_post, and dispatches observer hooks through the established nonblocking boundary. Focused Telegram tests and pnpm check pass.

# Conflicts:
#	docs/.generated/plugin-sdk-api-baseline/agent-harness-runtime.json
#	docs/.generated/plugin-sdk-api-baseline/agent-harness.json
#	docs/.generated/plugin-sdk-api-baseline/agent-runtime.json
#	docs/.generated/plugin-sdk-api-baseline/channel-contract.json
#	docs/.generated/plugin-sdk-api-baseline/channel-core.json
#	docs/.generated/plugin-sdk-api-baseline/channel-entry-contract.json
#	docs/.generated/plugin-sdk-api-baseline/channel-inbound.json
#	docs/.generated/plugin-sdk-api-baseline/channel-message.json
#	docs/.generated/plugin-sdk-api-baseline/channel-outbound.json
#	docs/.generated/plugin-sdk-api-baseline/channel-pairing.json
#	docs/.generated/plugin-sdk-api-baseline/channel-plugin-common.json
#	docs/.generated/plugin-sdk-api-baseline/command-auth-native.json
#	docs/.generated/plugin-sdk-api-baseline/command-auth.json
#	docs/.generated/plugin-sdk-api-baseline/config-runtime.json
#	docs/.generated/plugin-sdk-api-baseline/conversation-runtime.json
#	docs/.generated/plugin-sdk-api-baseline/core.json
#	docs/.generated/plugin-sdk-api-baseline/discord.json
#	docs/.generated/plugin-sdk-api-baseline/hook-runtime.json
#	docs/.generated/plugin-sdk-api-baseline/inbound-reply-dispatch.json
#	docs/.generated/plugin-sdk-api-baseline/media-runtime.json
#	docs/.generated/plugin-sdk-api-baseline/media-understanding-runtime.json
#	docs/.generated/plugin-sdk-api-baseline/meeting-runtime.json
#	docs/.generated/plugin-sdk-api-baseline/plugin-entry.json
#	docs/.generated/plugin-sdk-api-baseline/plugin-runtime.json
#	docs/.generated/plugin-sdk-api-baseline/provider-catalog-runtime.json
#	docs/.generated/plugin-sdk-api-baseline/reply-dispatch-runtime.json
#	docs/.generated/plugin-sdk-api-baseline/reply-runtime.json
#	docs/.generated/plugin-sdk-api-baseline/runtime-store.json
#	docs/.generated/plugin-sdk-api-baseline/session-catalog.json
#	docs/.generated/plugin-sdk-api-baseline/session-store-runtime.json
#	docs/.generated/plugin-sdk-api-baseline/tool-plugin.json
#	docs/.generated/plugin-sdk-api-baseline/webhook-ingress.json
@clawsweeper clawsweeper Bot added mantis: telegram-visible-proof Mantis should capture Telegram visible proof. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 11, 2026
@clawsweeper clawsweeper Bot added the status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. label Aug 11, 2026
# Conflicts:
#	docs/.generated/plugin-sdk-api-baseline/agent-harness-runtime.json
#	docs/.generated/plugin-sdk-api-baseline/agent-harness.json
#	docs/.generated/plugin-sdk-api-baseline/channel-core.json
#	docs/.generated/plugin-sdk-api-baseline/channel-entry-contract.json
#	docs/.generated/plugin-sdk-api-baseline/channel-message.json
#	docs/.generated/plugin-sdk-api-baseline/channel-outbound.json
#	docs/.generated/plugin-sdk-api-baseline/channel-plugin-common.json
#	docs/.generated/plugin-sdk-api-baseline/core.json
#	docs/.generated/plugin-sdk-api-baseline/discord.json
#	docs/.generated/plugin-sdk-api-baseline/inbound-reply-dispatch.json
#	docs/.generated/plugin-sdk-api-baseline/meeting-runtime.json
#	docs/.generated/plugin-sdk-api-baseline/plugin-entry.json
#	docs/.generated/plugin-sdk-api-baseline/plugin-runtime.json
#	docs/.generated/plugin-sdk-api-baseline/provider-catalog-runtime.json
#	docs/.generated/plugin-sdk-api-baseline/tool-plugin.json
#	docs/.generated/plugin-sdk-api-baseline/webhook-ingress.json
@mbelinky
mbelinky merged commit edb7a16 into main Aug 11, 2026
49 checks passed
@mbelinky
mbelinky deleted the codex/telegram-live-location-20260811 branch August 11, 2026 21:26
vincentkoc added a commit to tangtaizong666/openclaw that referenced this pull request Aug 11, 2026
…-prep

* commit 'edb7a1692e58d78ff7e196db39ea8eff297b2e19': (1351 commits)
  fix(telegram): expose live location updates to hooks (openclaw#122185)
  fix(ui): remove the pre-creation session row (openclaw#122259)
  fix(openai): surface failed realtime response outcomes (openclaw#121177)
  fix(logging): publish diagnostics ZIP through staged atomic overwrite (openclaw#122130)
  test(cli): trim duplicate MCP probe process cases (openclaw#122260)
  feat(agents): replay persisted native video (openclaw#122257)
  fix(test): serialize default e2e runner (openclaw#122203)
  fix(ui): always show full assistant responses (openclaw#122207)
  feat(mcp): per-requester OAuth for MCP servers (openclaw#122166)
  fix(ui): preserve focus on composer accessory clicks (openclaw#122243)
  fix(backup): exclude state temp files (openclaw#122250)
  fix(browser): let attached workers exit after CDP use (openclaw#122103)
  test(cli): trim duplicate Claw authoring process cases (openclaw#122248)
  refactor(outbound): inline delivery diagnostics (openclaw#122219)
  refactor: eliminate final wrapper-shadowing hazards (openclaw#122157)
  fix(ui): keep new-session identity anchored (openclaw#122242)
  test(cli): trim duplicate gateway process cases (openclaw#122240)
  fix(media): decode local file URLs safely (openclaw#122192)
  refactor(agents): centralize typed activity event emission (openclaw#122188)
  fix(ui): effort slider matches selected level after model switches (openclaw#122125)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 12, 2026
* fix(telegram): expose live location updates to hooks

* test(telegram): keep location coverage focused

* fix(telegram): emit stopped live locations

* test(plugin-sdk): refresh location hook contracts

* docs(changelog): note Telegram live location hooks

* fix(telegram): complete live-location observer path

---------

Co-authored-by: mbelinky <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: telegram Channel integration: telegram docs Improvements or additions to documentation maintainer Maintainer-authored PR mantis: telegram-visible-proof Mantis should capture Telegram visible proof. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. scripts Repository scripts size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant