fix(feishu): suppress late streaming card finals#72294
fix(feishu): suppress late streaming card finals#72294hxy91819 merged 3 commits intoopenclaw:mainfrom
Conversation
|
@codex take a look bro |
|
Codex Review: Didn't find any major issues. Another round soon, please! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Greptile SummaryThis PR introduces two boolean flags — One edge case: Confidence Score: 5/5Safe to merge; the primary fix is correct and the identified edge case requires a rare multi-error-recovery sequence within one reply. No P0 or P1 issues. The single P2 observation concerns a rare compound scenario (error + recovery + additional late final) that isn't addressed by existing tests but doesn't affect the core fix described in the PR. extensions/feishu/src/reply-dispatcher.ts around the closeStreaming guard on line 383. Prompt To Fix All With AIThis is a comment left during a code review.
Path: extensions/feishu/src/reply-dispatcher.ts
Line: 383-385
Comment:
**`streamingCloseErroredForReply` persists after recovery, blocking re-suppression**
`streamingCloseErroredForReply` is only reset in `onReplyStart`; it is never cleared after a successful recovery card closes within the same reply cycle. Because `closeStreaming` guards `streamingClosedForReply = true` behind `!streamingCloseErroredForReply`, a recovery final that completes successfully via `onIdle` will leave `streamingClosedForReply = false`. Any late finals arriving after the recovery card closes are therefore not suppressed — potentially producing duplicate cards for the recovery content.
Concretely, the sequence: error → `onError` (sets `streamingCloseErroredForReply = true`, clears `streamingClosedForReply`) → recovery final delivered → `onIdle` → `closeStreaming()` *(skips setting `streamingClosedForReply` due to the guard)* → additional late final → delivered unfiltered as a new card.
If recovery within a reply should re-enable suppression, consider clearing `streamingCloseErroredForReply` when `onIdle` determines the streaming session closed successfully (i.e. when `streamText` is non-empty and no error flag was re-set in the interim).
How can I resolve this? If you propose a fix, please make it concise.Reviews (4): Last reviewed commit: "fix(feishu): keep finals after streaming..." | Re-trigger Greptile |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7681c463e7
ℹ️ 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".
7681c46 to
97c4899
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 97c4899074
ℹ️ 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".
ba790e4 to
7a19b01
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7a19b01da3
ℹ️ 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".
7a19b01 to
bf4d207
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bf4d2071ad
ℹ️ 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".
bf4d207 to
b590a34
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b590a34646
ℹ️ 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".
b590a34 to
293885f
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 293885f295
ℹ️ 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".
293885f to
96458b4
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 96458b4f8b
ℹ️ 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".
96458b4 to
f049b5b
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f049b5ba62
ℹ️ 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".
|
@hxy91819 PTAL |
|
Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Keep this PR open. Current main still lacks the PR's distinct late-final suppression for Feishu streaming cards, and the latest PR head is the active implementation candidate for the closed linked bug, but the patch still needs maintainer review around lifecycle scoping and content-integrity tradeoffs before merge. Best possible solution: Keep this PR open as the active implementation candidate for #71977. Maintainers should review whether card-mode distinct late finals should be dropped, ensure the closed-stream suppression is scoped to the current reply lifecycle rather than a stale async close, and then land with the focused Feishu dispatcher regression tests plus the changed gate if the behavior is accepted. What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 0015d34fda79. |
f049b5b to
5e0e1a2
Compare
Resolved |
5e0e1a2 to
b96302c
Compare
b96302c to
d18a9ff
Compare
|
Merged via squash.
Thanks @MonkeyLeeT! |
Summary
finaltext deliveries after a Feishu streaming card has already closed for the current replyFixes #71977
Validation
pnpm test extensions/feishu/src/reply-dispatcher.test.tspnpm check:changedNotes
extensions/feishu/src/reply-dispatcher.tsandextensions/feishu/src/reply-dispatcher.test.ts.