fix(feishu): merge permission error notice into main dispatch instead of separate agent turn#27381
Merged
steipete merged 2 commits intoopenclaw:mainfrom Feb 26, 2026
Conversation
Contributor
Greptile SummaryFixed token-wasting double-reply bug in Feishu integration where permission errors triggered two separate agent turns. The fix consolidates both the permission error notification and the user message into a single agent turn by appending the error notice directly to Key changes:
Code quality:
Confidence Score: 5/5
Last reviewed commit: 2a6a2ee |
… of separate agent turn When the sender-name lookup fails with a Feishu permission error (code 99991672), the bot was dispatching two separate agent turns: 1. A dedicated permission-error notification turn 2. The regular inbound user message turn This caused two bot replies for a single user message, degrading UX and wasting tokens. Fix: instead of a separate dispatch, append the permission error notice directly to the main messageBody. The agent receives both the user's message and the system notice in a single turn, and responds once. Fixes openclaw#27372
2a6a2ee to
6a54fc9
Compare
Contributor
|
Landed via temp rebase onto main.
Thanks @byungsker! |
execute008
pushed a commit
to execute008/openclaw
that referenced
this pull request
Feb 27, 2026
r4jiv007
pushed a commit
to r4jiv007/openclaw
that referenced
this pull request
Feb 28, 2026
vincentkoc
pushed a commit
to Sid-Qin/openclaw
that referenced
this pull request
Feb 28, 2026
vincentkoc
pushed a commit
to rylena/rylen-openclaw
that referenced
this pull request
Feb 28, 2026
6 tasks
hughdidit
pushed a commit
to hughdidit/DAISy-Agency
that referenced
this pull request
Mar 1, 2026
…aw#27381) (thanks @byungsker) (cherry picked from commit cf4853e) # Conflicts: # extensions/feishu/src/bot.test.ts
steipete
added a commit
to Sid-Qin/openclaw
that referenced
this pull request
Mar 2, 2026
robertchang-ga
pushed a commit
to robertchang-ga/openclaw
that referenced
this pull request
Mar 2, 2026
hughdidit
pushed a commit
to hughdidit/DAISy-Agency
that referenced
this pull request
Mar 3, 2026
…aw#27381) (thanks @byungsker) (cherry picked from commit cf4853e) # Conflicts: # extensions/feishu/src/bot.test.ts
dorgonman
pushed a commit
to kanohorizonia/openclaw
that referenced
this pull request
Mar 3, 2026
zooqueen
pushed a commit
to hanzoai/bot
that referenced
this pull request
Mar 6, 2026
thebenjaminlee
pushed a commit
to escape-velocity-ventures/openclaw
that referenced
this pull request
Mar 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When sender-name lookup fails with a Feishu permission error (code
99991672), the bot dispatched two separate agent turns:This caused two bot replies for every single user message when the
contact:contactscope is missing, wasting tokens and confusing users.Root Cause
Fix
Append the permission error notice directly to
messageBodybefore the single main dispatch. The agent receives both the user's message and the system notice in one turn, and responds once.Result: -52 lines, single coherent response per user message.
Fixes #27372