Repository navigation
Description
Bug type
Behavior bug (incorrect output/state without crash)
Beta release blocker
No
Summary
Performance: every Telegram polling worker evaluates the debug proxy capture store at startup although capture stays off unless OPENCLAW_DEBUG_PROXY_ENABLED is set, so each polling account carries about 20 MiB of worker heap and about 280 ms of startup CPU for code that never runs.
Steps to reproduce
- Check out
mainat0ce08d269ffand build it (dist/telegram-ingress-worker.runtime.js). - Start that worker with the
workerDatacontractcreateTelegramIngressWorkeruses (runtime marker, token, API root, timeout) against a loopback Bot API that answersgetUpdates, with a module load hook installed in the worker. - After the first successful poll, count the evaluated modules and read the worker heap after a full GC.
The linked PR adds scripts/perf/telegram-ingress-worker-measure.mjs, which does this for one or two built checkouts; the numbers below come from it.
Expected behavior
With debug proxy capture off (the default), the polling worker loads what getUpdates needs. resolveEffectiveDebugProxyUrl and captureHttpExchangeAsync only do work when the debug proxy is enabled, and main-thread Telegram requests keep their capture behavior either way.
Actual behavior
telegram-ingress-worker.runtime.ts imports resolveTelegramTransport from fetch.ts, and fetch.ts statically imports openclaw/plugin-sdk/proxy-capture. That SDK facade re-exports the capture env, runtime and store modules, so every worker evaluates the whole capture store graph before its first poll. The worker also takes its runtime marker from the parent-side factory telegram-ingress-worker.ts, which pulls in openclaw/plugin-sdk/process-runtime.
Built worker on 0ce08d269ff, loopback Bot API, 10 samples, idle host:
| Per worker | median | p95 |
|---|---|---|
| Evaluated modules | 1,794 | 1,794 |
| Heap after full GC | 42.21 MiB | 42.22 MiB |
| Construction → first poll-success | 486.7 ms | 662.0 ms |
| Worker CPU to first poll-success | 483.7 ms | 543.6 ms |
The same build loaded with only the transport core and no capture graph evaluates 550 modules and retains 21.86 MiB.
Whole Gateway with three Telegram polling accounts (built dist, network-less sandbox, 5 boots, full GC through the inspector): each of the three Telegram workers holds 42.1 MiB.
OpenClaw version
main at 0ce08d269ff. v2026.10.9 has the same import chain (checked in source, not measured).
Operating system
Ubuntu 26.04.1 LTS x86_64 (Node 26.13)
Install method
Source checkout (built dist)
Model
Any model; the cost is paid when a polling worker starts.
Provider / routing chain
Any. Telegram channel in polling mode, which runs one ingress worker per account.
Additional provider/model setup details
Default config: debug proxy capture off.
Impact and severity
Each Telegram polling account holds about 20 MiB of extra worker heap for as long as the Gateway runs, so three accounts hold about 60 MiB. Every polling restart pays the import again before its first poll.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
clawsweeper commentedon Nov 2, 2026
Codex review: this still needs some work.
Summary
Current main retains the unnecessary capture imports, and the same author’s open closing PR requires this issue to remain open.
Reproducibility: Current source establishes the unconditional worker-to-transport-to-capture-store import path despite capture’s disabled-settings guard; the contributor supplies built-worker and Gateway measurements, but this review executed no product code.
Root-cause cluster
Relationship:
canonicalCanonical: #190889
Summary: This issue tracks the eager capture import overhead, and its paired open PR owns the proposed repair.
Members:
fixed_by_candidate: improve(telegram): polling workers start faster and use half the memory #190890 - The PR explicitly closes this issue and changes the exact transport and worker-marker import paths identified by the report.Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.
Next step
Resolve conflicts in #190890, then verify disabled-capture loading and enabled-capture behavior on its updated head before merging.
Review details
Best possible solution:
Keep one shared Telegram transport implementation while loading capture dependencies only when existing capture settings enable them.
Do we have a high-confidence way to reproduce the issue?
Current source establishes the unconditional worker-to-transport-to-capture-store import path despite capture’s disabled-settings guard; the contributor supplies built-worker and Gateway measurements, but this review executed no product code.
Is this the best way to solve the issue?
Separating optional capture dependencies from the existing transport addresses the source-proven waste while preserving polling acknowledgement, proxy routing, and enabled capture behavior.
AGENTS.md: found and applied where relevant.
Remaining risk / open question:
Codex review notes: model internal, reasoning medium; reviewed against b6a0808d1235.
Label changes
Label changes:
No label changes.
Label justifications:
P2: Avoidable startup CPU and retained memory scale with polling accounts, without demonstrated current message loss or an availability failure.impact:other: The demonstrated impact is unnecessary worker dependency loading and reported memory and CPU overhead.Evidence reviewed
What I checked:
extensions/telegram/src/telegram-ingress-worker.runtime.ts:12, b6a0808d1235)extensions/telegram/src/fetch.ts:26, b6a0808d1235)src/plugin-sdk/proxy-capture.ts:6, b6a0808d1235)extensions/telegram/src/telegram-ingress-worker.runtime.ts:12, fd244fd76de3)How this review workflow works
@clawsweeper re-reviewcomments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.@clawsweeper re-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only.@clawsweeper reviewto request a fresh review only.@clawsweeper explainto ask for more context, or@clawsweeper stopto stop active automation.Reviewed November 26, 2026, 4:16 AM ET / 09:16 UTC.
openclaw-barnacle commentedon Nov 15, 2026
This issue has been automatically marked as stale after 7 days without qualifying human activity.
Without new human activity, Barnacle may close it as not planned 7 days after this message was posted. This is administrative inactivity cleanup, not a claim that the problem is fixed.
A human update restarts the inactivity clock; a new PR head also restarts it. A maintainer can add no-stale for a durable hold, or bad-barnacle to suppress Barnacle. Remove the hold when work can resume.