Skip to content

Measure Telegram QA reply RTT#70550

Merged
obviyus merged 6 commits into
openclaw:mainfrom
obviyus:wip/telegram-qa-rtt
Apr 23, 2026
Merged

Measure Telegram QA reply RTT#70550
obviyus merged 6 commits into
openclaw:mainfrom
obviyus:wip/telegram-qa-rtt

Conversation

@obviyus

@obviyus obviyus commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

Summary

  • record per-scenario Telegram QA reply RTT in reports and JSON summaries
  • cache Telegram forum metadata lookups so group command handling avoids repeated getChat calls

Validation

  • pnpm test extensions/telegram/src/bot/helpers.test.ts extensions/qa-lab/src/live-transports/telegram/telegram-live.runtime.test.ts
  • pnpm check:changed (pre-commit, both scoped commits)
  • live Telegram QA command run: 4/4 passed; command RTTs 1255ms, 1159ms, 2220ms

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: telegram Channel integration: telegram extensions: qa-lab size: S maintainer Maintainer-authored PR labels Apr 23, 2026
@greptile-apps

greptile-apps Bot commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds per-scenario Telegram QA reply RTT (driver send → observed SUT reply) to Markdown reports and JSON summaries, and caches supergroup forum-flag lookups in a module-level Map to avoid repeated getChat calls. Both changes are well-tested with unique chatIds preventing cross-test cache pollution.

Confidence Score: 5/5

Safe to merge; all remaining findings are minor P2 suggestions that do not affect correctness.

No P0/P1 issues found. The two P2 comments cover an unbounded cache (rare operational edge case) and a minor timing granularity point in the RTT measurement. Both are non-blocking quality suggestions.

No files require special attention beyond the P2 notes on helpers.ts and telegram-live.runtime.ts.

Prompt To Fix All With AI
This is a comment left during a code review.
Path: extensions/telegram/src/bot/helpers.ts
Line: 43

Comment:
**Unbounded module-level cache with no expiry**

`telegramForumFlagByChatId` accumulates entries for the lifetime of the process and never evicts stale data. If a supergroup's forum status changes (upgraded or downgraded), the cached boolean will silently remain wrong until the process restarts. A `WeakRef`-based expiry or a simple TTL wrapper would make the cache resilient to that operational change — or at minimum, a comment noting the intent to cache for the process lifetime would help maintainers understand the scope.

How can I resolve this? If you propose a fix, please make it concise.

---

This is a comment left during a code review.
Path: extensions/qa-lab/src/live-transports/telegram/telegram-live.runtime.ts
Line: 616

Comment:
**`observedAtMs` captures loop-iteration time, not message-receipt time**

`Date.now()` is called after iterating over the `updates` batch and finding the matching message. If the batch contains several messages before the matching one, the timestamp reflects when the loop body reached that entry, not when the HTTP response arrived. For more accurate RTT, capture `Date.now()` once immediately after `callTelegramApi` returns (before the inner loop) and use that as the observation timestamp for all messages in that batch.

How can I resolve this? If you propose a fix, please make it concise.

Reviews (1): Last reviewed commit: "perf(telegram): cache forum metadata loo..." | Re-trigger Greptile

Comment thread extensions/telegram/src/bot/helpers.ts Outdated
Comment thread extensions/qa-lab/src/live-transports/telegram/telegram-live.runtime.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6750a17620

ℹ️ 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".

Comment thread extensions/telegram/src/bot/helpers.ts
@obviyus obviyus self-assigned this Apr 23, 2026
@obviyus
obviyus force-pushed the wip/telegram-qa-rtt branch from da7c550 to ea267b9 Compare April 23, 2026 09:01
@obviyus
obviyus merged commit 57f2828 into openclaw:main Apr 23, 2026
11 checks passed
obviyus added a commit that referenced this pull request Apr 23, 2026
@obviyus

obviyus commented Apr 23, 2026

Copy link
Copy Markdown
Contributor Author

Landed on main.

@aisle-research-bot

aisle-research-bot Bot commented Apr 23, 2026

Copy link
Copy Markdown

🔒 Aisle Security Analysis

We found 1 potential security issue(s) in this PR:

# Severity Title
1 🟡 Medium OPENCLAW_QA_REDACT_PUBLIC_METADATA does not redact per-scenario timing and timestamps in Telegram QA artifacts
1. 🟡 OPENCLAW_QA_REDACT_PUBLIC_METADATA does not redact per-scenario timing and timestamps in Telegram QA artifacts
Property Value
Severity Medium
CWE CWE-200
Location extensions/qa-lab/src/live-transports/telegram/telegram-live.runtime.ts:1073-1085

Description

The Telegram QA live runtime adds per-scenario timing fields (rttMs, requestStartedAt, responseObservedAt) and writes them into artifacts (Markdown report + JSON summary).

Even when OPENCLAW_QA_REDACT_PUBLIC_METADATA=1 (intended to redact metadata before publishing artifacts), these timing fields are still recorded and emitted:

  • scenarioResults.push(...) always includes rttMs, requestStartedAt, and responseObservedAt regardless of redactPublicMetadata
  • renderTelegramQaMarkdown() prints - RTT: ...ms whenever scenario.rttMs is present, independent of redaction

This can cause information disclosure by leaking precise operational timestamps and per-reply latency that can be used to correlate runs, infer internal performance/availability characteristics, and potentially correlate chat activity patterns even when other metadata is redacted.

Vulnerable code (example for canary scenario):

scenarioResults.push({
  ...
  details: redactPublicMetadata
    ? `reply matched in ${canaryTiming.rttMs}ms`
    : `reply message ${canaryTiming.responseMessageId} matched in ${canaryTiming.rttMs}ms`,
  rttMs: canaryTiming.rttMs,
  requestStartedAt: canaryTiming.requestStartedAt,
  responseObservedAt: canaryTiming.responseObservedAt,
  sentMessageId: redactPublicMetadata ? undefined : canaryTiming.sentMessageId,
  responseMessageId: redactPublicMetadata ? undefined : canaryTiming.responseMessageId,
});

Recommendation

When OPENCLAW_QA_REDACT_PUBLIC_METADATA=1, avoid writing high-resolution timing metadata to published artifacts.

Options:

  • Redact these fields entirely (set to undefined) when redactPublicMetadata is true.
  • Or coarsen the data (e.g., bucket RTT to ranges, omit absolute timestamps).

Example fix (full redaction):

const timingFields = redactPublicMetadata
  ? {}
  : {
      rttMs: canaryTiming.rttMs,
      requestStartedAt: canaryTiming.requestStartedAt,
      responseObservedAt: canaryTiming.responseObservedAt,
    };

scenarioResults.push({
  id: "telegram-canary",
  title: "Telegram canary",
  status: "pass",
  details: redactPublicMetadata ? "reply matched" : `reply message ${canaryTiming.responseMessageId} matched`,
  ...timingFields,
  sentMessageId: redactPublicMetadata ? undefined : canaryTiming.sentMessageId,
  responseMessageId: redactPublicMetadata ? undefined : canaryTiming.responseMessageId,
});

Also ensure renderTelegramQaMarkdown() respects redaction (e.g., only print RTT when not redacted).


Analyzed PR: #70550 at commit 4060526

Last updated on: 2026-04-23T09:11:11Z

ogt-redknie pushed a commit to ogt-redknie/OPENX that referenced this pull request May 2, 2026
ogt-redknie pushed a commit to ogt-redknie/OPENX that referenced this pull request May 2, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 9, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 9, 2026
globalcaos pushed a commit to globalcaos/tinkerclaw that referenced this pull request May 13, 2026
globalcaos pushed a commit to globalcaos/tinkerclaw that referenced this pull request May 13, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 24, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 24, 2026
jameslcowan pushed a commit to jameslcowan/openclaw that referenced this pull request Jun 2, 2026
jameslcowan pushed a commit to jameslcowan/openclaw that referenced this pull request Jun 2, 2026
sablehead pushed a commit to sablehead/openclaw that referenced this pull request Jun 10, 2026
sablehead pushed a commit to sablehead/openclaw that referenced this pull request Jun 10, 2026
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 extensions: qa-lab maintainer Maintainer-authored PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant