Repository navigation
Fix/telegram humandelay - #69879
Fix/telegram humandelay#69879Eruditi wants to merge 32 commits into
Conversation
The Telegram extension was not passing the humanDelay configuration to the buffered block dispatcher, which meant typing delay settings were being ignored for Telegram messages. Fixes openclaw#68945
Greptile SummaryThis PR wires the Confidence Score: 5/5Safe to merge — minimal, well-tested change with no logic or security concerns. The change is a one-line addition in production code and a corresponding mock + assertion in tests. No edge-case risks, no security surface changes, and the new test correctly validates both the resolver call signature and the downstream option propagation. No files require special attention. Reviews (1): Last reviewed commit: "Merge branch 'openclaw:main' into fix/te..." | Re-trigger Greptile |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 81fb47e37f
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| vi.mock("openclaw/plugin-sdk/agent-runtime", () => ({ | ||
| resolveHumanDelayConfig, | ||
| })); |
There was a problem hiding this comment.
Preserve other agent-runtime exports in test mock
Replace this full-module mock with a partial mock (importOriginal) or a local seam, because returning only resolveHumanDelayConfig removes other exports from openclaw/plugin-sdk/agent-runtime that bot-message-dispatch uses transitively (for example extensions/telegram/src/reasoning-lane-coordinator.ts imports formatReasoningMessage). In reasoning-tag scenarios (e.g. existing <think>... dispatch paths), Vitest will hit a missing export and fail the suite, so this change can make unrelated Telegram dispatch tests fail.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5a31efc48c
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| vi.mock("openclaw/plugin-sdk/agent-runtime", () => ({ | ||
| resolveHumanDelayConfig, | ||
| })); |
There was a problem hiding this comment.
Preserve all agent-runtime exports in this module mock
This replaces the entire openclaw/plugin-sdk/agent-runtime module with only resolveHumanDelayConfig, which drops other named exports that Telegram dispatch dependencies still import and can cause runtime failures in this test file. Fresh evidence in the current tree: extensions/telegram/src/reasoning-lane-coordinator.ts still imports formatReasoningMessage from openclaw/plugin-sdk/agent-runtime and calls it in reasoning-tag paths, so those scenarios can throw when this mock is active. Prefer a partial mock or local seam so non-target exports remain intact.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fd19f2a59d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
|
||
| await dispatchWithContext({ context: createContext() }); | ||
|
|
||
| expect(resolveHumanDelayConfig).toHaveBeenCalledWith(expect.any(Object), "test-agent"); |
There was a problem hiding this comment.
Match humanDelay assertion to the context agent id
createContext() defaults route.agentId to "default", but this new assertion expects resolveHumanDelayConfig to be called with "test-agent"; that mismatch makes the new test fail even when the implementation is correct, which blocks CI and hides the real behavior under test. Either override the context route in this test or assert the default agent id value that is actually passed.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2d6677025c
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| vi.mock("openclaw/plugin-sdk/agent-runtime", () => ({ | ||
| resolveHumanDelayConfig, | ||
| })); |
There was a problem hiding this comment.
Use partial mock for agent-runtime exports
This full-module mock replaces openclaw/plugin-sdk/agent-runtime with only resolveHumanDelayConfig, which strips other exports that this same test file's import graph still uses (notably reasoning paths that call formatReasoningMessage via reasoning-lane-coordinator.ts), causing runtime failures when those scenarios execute. Fresh evidence in this commit is the newly added full mock at this location while existing reasoning-stream tests in this file remain active.
Useful? React with 👍 / 👎.
|
|
||
| await dispatchWithContext({ context: createContext() }); | ||
|
|
||
| expect(resolveHumanDelayConfig).toHaveBeenCalledWith(expect.any(Object), "test-agent"); |
There was a problem hiding this comment.
Assert the actual route agent ID in this new test
The new expectation hard-codes "test-agent", but this test calls createContext() without overrides, and that helper defaults route.agentId to "default", so the assertion fails even when behavior is correct. Fresh evidence in this commit is the new assertion here combined with the unchanged createContext default route in the same file.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 90f02e5f51
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| vi.mock("openclaw/plugin-sdk/agent-runtime", () => ({ | ||
| resolveHumanDelayConfig, | ||
| })); |
There was a problem hiding this comment.
Preserve non-target exports in agent-runtime mock
Replace this full-module mock with a partial mock, because returning only resolveHumanDelayConfig removes other openclaw/plugin-sdk/agent-runtime exports needed by this test file’s import graph; fresh evidence is that extensions/telegram/src/reasoning-lane-coordinator.ts still imports formatReasoningMessage from that module and is exercised by reasoning-lane dispatch scenarios in bot-message-dispatch.test.ts. When those scenarios run under this mock, Vitest can hit missing exports and fail unrelated Telegram dispatch tests.
Useful? React with 👍 / 👎.
|
|
||
| await dispatchWithContext({ context: createContext() }); | ||
|
|
||
| expect(resolveHumanDelayConfig).toHaveBeenCalledWith(expect.any(Object), "test-agent"); |
There was a problem hiding this comment.
Assert the actual agent id passed by createContext
This expectation hard-codes "test-agent", but the same test calls createContext() without overrides and that helper defaults route.agentId to "default" (createContext base route), so the new test fails even if dispatchTelegramMessage is correct. Use the default id or override route.agentId in the test setup so the assertion matches the real input.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bf814d93c8
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| vi.mock("openclaw/plugin-sdk/agent-runtime", () => ({ | ||
| resolveHumanDelayConfig, | ||
| })); |
There was a problem hiding this comment.
Keep agent-runtime mock exports intact
Replace this full-module mock with a partial mock or local seam, because returning only resolveHumanDelayConfig removes other exports from openclaw/plugin-sdk/agent-runtime that the same import graph still uses. In this commit, bot-message-dispatch.ts continues to import ./reasoning-lane-coordinator.js, and reasoning-lane-coordinator.ts statically imports formatReasoningMessage; with the current mock, those paths can throw missing-export errors and fail unrelated dispatch tests.
Useful? React with 👍 / 👎.
|
|
||
| await dispatchWithContext({ context: createContext() }); | ||
|
|
||
| expect(resolveHumanDelayConfig).toHaveBeenCalledWith(expect.any(Object), "test-agent"); |
There was a problem hiding this comment.
Assert the agent id actually passed by createContext
This assertion hard-codes "test-agent", but this test calls createContext() with no route override, and the helper defaults route.agentId to "default" (same file), so the new test fails even when dispatchTelegramMessage is correct. Either override context.route.agentId in this test or assert the default value that is actually passed.
Useful? React with 👍 / 👎.
|
Closing this as duplicate or superseded after Codex automated review. PR #69879 is a duplicate/superseded Telegram humanDelay fix. Current main still lacks the Telegram wiring, but the same remaining bug is already tracked by the earlier open PR #69022, which directly resolves #68945, uses the local Telegram runtime seam, has a focused test, and has maintainer triage calling it the better humanDelay PR. #69879 also has unresolved review findings around its whole-module test mock and hard-coded agent id assertion. Best possible solution: Close #69879 as duplicate/superseded and keep #69022 as the canonical implementation path for #68945. Maintainers should land #69022, or an equivalent local-runtime-barrel fix, once review state is acceptable; #68945 should remain open until that fix ships. What I checked:
So I’m closing this here and keeping the remaining discussion on the canonical linked item. Codex Review notes: model gpt-5.5, reasoning high; reviewed against 8bbb143ab87e. |
Summary
Describe the problem and fix in 2–5 bullets:
If this PR fixes a plugin beta-release blocker, title it
fix(<plugin-id>): beta blocker - <summary>and link the matchingBeta blocker: <plugin-name> - <summary>issue labeledbeta-blocker. Contributors cannot label PRs, so the title is the PR-side signal for maintainers and automation.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Root Cause (if applicable)
For bug fixes or regressions, explain why this happened, not just what changed. Otherwise write
N/A. If the cause is unclear, writeUnknown.Regression Test Plan (if applicable)
For bug fixes or regressions, name the smallest reliable test coverage that should catch this. Otherwise write
N/A.User-visible / Behavior Changes
List user-visible changes (including defaults/config).
If none, write
None.Diagram (if applicable)
For UI changes or non-trivial logic flows, include a small ASCII diagram reviewers can scan quickly. Otherwise write
N/A.Security Impact (required)
Yes/No)Yes/No)Yes/No)Yes/No)Yes/No)Yes, explain risk + mitigation:Repro + Verification
Environment
Steps
Expected
Actual
Evidence
Attach at least one:
Human Verification (required)
What you personally verified (not just CI), and how:
Review Conversations
If a bot review conversation is addressed by this PR, resolve that conversation yourself. Do not leave bot review conversation cleanup for maintainers.
Compatibility / Migration
Yes/No)Yes/No)Yes/No)Risks and Mitigations
List only real risks for this PR. Add/remove entries as needed. If none, write
None.