Skip to content

[codex] Route Telegram management commands to the control lane - #81592

Closed
Kyzcreig wants to merge 1 commit into
openclaw:mainfrom
Kyzcreig:codex/telegram-control-lane
Closed

Kyzcreig wants to merge 1 commit into
openclaw:mainfrom
Kyzcreig:codex/telegram-control-lane

Conversation

@Kyzcreig

Copy link
Copy Markdown
Contributor

Summary

Routes Telegram /steer, /tell, and /queue text commands onto the existing per-chat control sequentialization lane.

Why

Telegram updates are sequentialized by chat/thread so normal messages do not race with each other. That is correct for conversational messages, but management commands that are intended to affect an active run should not wait behind the same long-running message they are trying to control.

/stop and status commands already bypass the normal chat lane. This gives /steer, its /tell alias, and /queue the same immediate lane behavior.

Validation

  • vitest run extensions/telegram/src/sequential-key.test.ts
  • oxfmt --check --threads=1 extensions/telegram/src/sequential-key.ts extensions/telegram/src/sequential-key.test.ts

@openclaw-barnacle openclaw-barnacle Bot added triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. channel: telegram Channel integration: telegram size: XS labels May 14, 2026
@clawsweeper

clawsweeper Bot commented May 14, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed August 1, 2026, 1:51 PM ET / 17:51 UTC.

ClawSweeper review

What this changes

This draft routes Telegram /steer, /tell, and /queue text commands onto a per-chat control lane so they do not wait behind the busy conversation lane.

Merge readiness

⛔ Blocked until real behavior proof is added - 9 items remain

Close this PR as superseded by #98126.

Priority: P3
Reviewed head: 0cde4f7edb0937ea355ee98c0ab5149bfba3ed48
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The draft is stale, conflicts with the current design, retains a routing gap, and lacks the required real behavior proof.
Proof confidence 🧂 unranked krab (1/6) Needs real behavior proof before merge: The PR body lists focused tests only; no after-fix Telegram transcript, recording, terminal output, logs, or linked artifact demonstrates the routing behavior. Any future proof should redact private identifiers, endpoints, and credentials. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🦪 silver shellfish (2/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The PR body lists focused tests only; no after-fix Telegram transcript, recording, terminal output, logs, or linked artifact demonstrates the routing behavior. Any future proof should redact private identifiers, endpoints, and credentials. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 3 items linked superseding PR: #98126 (Restore Telegram /steer for active Codex runs) is merged at 2026-07-01T17:34:22Z.
cluster evidence: the durable review links that PR in the work cluster or recommended risk path.
no human follow-up: live comments and timeline hydrated by apply contain no non-automation activity after the ClawSweeper review.
Findings 1 actionable finding [P2] Handle targeted commands before bot metadata resolves
Security None None.

How this fits together

Telegram update handling assigns an inbound message to a sequential lane before command dispatch reaches the active run. Management commands use the control lane to bypass a busy chat or topic lane while ordinary messages remain ordered.

flowchart LR
  A[Telegram update] --> B[Command and target parsing]
  B --> C[Sequential-key selection]
  C --> D{Control command?}
  D -->|Yes| E[Per-chat control lane]
  D -->|No| F[Chat or topic lane]
  E --> G[Active-run command handling]
  F --> G
Loading

Decision needed

Question Recommendation
Can a maintainer confirm that the current-main Telegram classifier and the merged repair at #98126 are the canonical shipped-or-main-only replacement, despite this checkout lacking the required sibling Codex source and complete ancestry? Confirm supersession and close: Confirm the broader merged/current-main path as canonical, then close this stale draft as mostly implemented on main.

Why: Repository policy forbids a Codex-related close verdict without direct sibling Codex inspection, while the available current source strongly suggests the draft is already superseded.

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The PR body lists focused tests only; no after-fix Telegram transcript, recording, terminal output, logs, or linked artifact demonstrates the routing behavior. Any future proof should redact private identifiers, endpoints, and credentials. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Handle targeted commands before bot metadata resolves (P2) - When ctx.me is unavailable, this helper passes /steer@bot through normalizeCommandBody without a username, so it does not resolve the alias and stays on the normal lane. Current main parses the target independently and has coverage for this case. This is the prior blocker, still present on the unchanged head.
  • Resolve merge risk (P1) - The draft is dirty against current main; rebasing its two-alias helper would duplicate a broader registered-command classifier and could regress targeted-command handling.
  • Resolve merge risk (P1) - The PR has no after-fix real Telegram proof despite dated proof requests, so its behavior has not been demonstrated in a contributor setup.
  • Resolve merge risk (P1) - A terminal supersession close still lacks required Codex dependency inspection and release/main ancestry provenance in this read-only checkout.
  • Complete next step (P2) - A maintainer must resolve the missing Codex dependency gate and incomplete release/ancestry provenance before this supersession can be closed safely.
  • Improve patch quality - Do not revive this branch if the current-main supersession is confirmed.
  • Improve patch quality - If replacement work is necessary, start from current main and add targeted-command plus redacted live Telegram proof.

Findings

  • [P2] Handle targeted commands before bot metadata resolves — extensions/telegram/src/sequential-key.ts:55-60
Agent review details

Security

None.

PR surface

Source +20, Tests +22. Total +42 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 20 0 +20
Tests 1 22 0 +22
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 42 0 +42

Review metrics

None.

Merge-risk options

Maintainer options:

  1. Do not rebase the stale helper (recommended)
    Use the current registered-command classifier rather than reviving this branch’s two-alias routing helper.
  2. Refresh only with complete proof
    If the current behavior is shown incomplete, replace this branch with a fresh focused patch plus targeted-command and real Telegram proof.

Technical review

Best possible solution:

Close this PR as superseded by #98126.

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

No live Telegram run was performed. Current source and tests provide a clear source-level path for the command-to-control-lane behavior, but the contributor did not supply after-fix runtime evidence.

Is this the best way to solve the issue?

No. Current main uses a broader command-metadata classifier with targeted-command protections, whereas this branch hardcodes two aliases and retains the missing-bot-metadata case from the prior review.

Full review comments:

  • [P2] Handle targeted commands before bot metadata resolves — extensions/telegram/src/sequential-key.ts:55-60
    When ctx.me is unavailable, this helper passes /steer@bot through normalizeCommandBody without a username, so it does not resolve the alias and stays on the normal lane. Current main parses the target independently and has coverage for this case. This is the prior blocker, still present on the unchanged head.
    Confidence: 0.96
    Late finding: first raised on code an earlier review cycle already covered.

Overall correctness: patch is incorrect
Overall confidence: 0.9

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This is now a stale-draft cleanup decision because current main appears to cover the central behavior.
  • add merge-risk: 🚨 message-delivery: Incorrect sequential-lane selection can delay or misroute Telegram commands intended to control an active run.
  • remove P1: Current review triage priority is P3, so this older priority label is no longer current.

Label justifications:

  • P3: This is now a stale-draft cleanup decision because current main appears to cover the central behavior.
  • merge-risk: 🚨 message-delivery: Incorrect sequential-lane selection can delay or misroute Telegram commands intended to control an active run.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦪 silver shellfish.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body lists focused tests only; no after-fix Telegram transcript, recording, terminal output, logs, or linked artifact demonstrates the routing behavior. Any future proof should redact private identifiers, endpoints, and credentials. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • mantis: telegram-visible-proof: Mantis should capture Telegram visible proof. Whether these commands bypass a busy run is directly observable in a short Telegram transcript or recording.

Evidence

What I checked:

  • linked superseding PR: Restore Telegram /steer for active Codex runs #98126 (Restore Telegram /steer for active Codex runs) is merged at 2026-07-01T17:34:22Z.
  • cluster evidence: the durable review links that PR in the work cluster or recommended risk path.
  • no human follow-up: live comments and timeline hydrated by apply contain no non-automation activity after the ClawSweeper review.

Likely related people:

  • Peter Steinberger: Current main’s alias parsing and active-run control-lane classifier are attributed to this recent source boundary in blame. (role: recent area contributor; confidence: medium; commits: 9e43844264a7; files: extensions/telegram/src/sequential-key.ts, extensions/telegram/src/sequential-key.test.ts)
  • Eva: Authored the merge commit for the broader active-run steering repair described by the merged replacement PR. (role: merged related-repair author; confidence: medium; commits: 8d9a7ab2cab6; files: extensions/telegram/src/sequential-key.ts)
  • 100yenadmin: Authored the merged replacement PR that explicitly records this draft as superseded and includes the same Telegram control-lane scope. (role: related-repair contributor; confidence: medium; commits: 6912ef43f0f4; files: extensions/telegram/src/sequential-key.ts, extensions/codex/src/app-server/run-attempt.steering.test.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-07-01T00:53:54.128Z sha 0cde4f7 :: needs real behavior proof before merge. :: [P2] Handle targeted management commands without bot metadata

@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label May 28, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. labels May 28, 2026
@clawsweeper

clawsweeper Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper PR egg: 🎁 locked until real behavior proof passes.

Details
  • No creature or rarity is rolled until proof passes.
  • Eggs are collectible flavor only; they do not affect labels, ratings, merge decisions, or automation.

@openclaw-barnacle openclaw-barnacle Bot removed the stale Marked as stale due to inactivity label May 29, 2026
@clawsweeper

clawsweeper Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

@Kyzcreig thanks for the PR. ClawSweeper is still waiting on real behavior proof before this can move forward.

Useful proof can be a screenshot, short video, terminal output, copied live output, linked artifact, or redacted logs that show the changed behavior after the fix. Please redact private tokens, phone numbers, private endpoints, customer data, and anything else sensitive.

Once proof is added to the PR body or a comment, ClawSweeper or a maintainer can re-check it.

@clawsweeper

clawsweeper Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

@Kyzcreig thanks for the PR. ClawSweeper is still waiting on real behavior proof before this can move forward.

Useful proof can be a screenshot, short video, terminal output, copied live output, linked artifact, or redacted logs that show the changed behavior after the fix. Please redact private tokens, phone numbers, private endpoints, customer data, and anything else sensitive.

Once proof is added to the PR body or a comment, ClawSweeper or a maintainer can re-check it.

@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added stale Marked as stale due to inactivity triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Jul 30, 2026
@clawsweeper clawsweeper Bot removed the merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. label Jul 30, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the stale Marked as stale due to inactivity label Jul 31, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. and removed P1 High-priority user-facing bug, regression, or broken workflow. labels Aug 1, 2026
@vincentkoc

Copy link
Copy Markdown
Member

Closing as superseded.

Current main already routes /steer, /tell, and /queue through Telegram's control lane in bfc4e1d. That landed implementation also uses the canonical command registry, handles /tell as the /steer alias, and covers bot-targeted commands without diverting commands addressed to another bot.

The current Telegram control-lane regression suite passes in full, and the upstream Codex contract still exposes turn/steer. There is no correct unique remainder from this draft to land.

Thanks for identifying the active-run sequencing gap.

@vincentkoc vincentkoc self-assigned this Aug 4, 2026
@vincentkoc vincentkoc closed this Aug 4, 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 mantis: telegram-visible-proof Mantis should capture Telegram visible proof. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: XS status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants