Skip to content

fix(feishu): scope sequential queue by group session - #72972

Closed
AaronLuo00 wants to merge 1 commit into
openclaw:mainfrom
AaronLuo00:fix/feishu-topic-sequential-key
Closed

AaronLuo00 wants to merge 1 commit into
openclaw:mainfrom
AaronLuo00:fix/feishu-topic-sequential-key

Conversation

@AaronLuo00

@AaronLuo00 AaronLuo00 commented Apr 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fix Feishu inbound queue scoping so grouped sessions are not still serialized at the whole-chat level.

When groupSessionScope is configured as group_topic or group_topic_sender, Feishu conversations are already routed into separate sessions, but getFeishuSequentialKey still returned feishu:<accountId>:<chatId> for normal messages. That meant a long-running request in one Feishu group topic could block unrelated topics/senders in the same group.

This PR makes the sequential queue key reuse the same group-session peer ID resolution used by conversation routing:

  • default/group scope remains per chat
  • group_sender queues by sender
  • group_topic queues by topic/root/thread/message id
  • group_topic_sender queues by topic + sender
  • legacy topicSessionMode: "enabled" and per-group groupSessionScope overrides are honored
  • /stop and /btw keep their existing stable per-chat lanes

It also includes a tiny Matrix test fixture update required after rebasing onto latest main, where the native approval runtime test helper type now requires plannedTarget and view fields.

Tests

  • pnpm test extensions/feishu/src/sequential-key.test.ts
  • pnpm test extensions/matrix/src/approval-handler.runtime.test.ts
  • pnpm test:extension feishu — 60 files / 678 tests passed
  • pnpm check:test-types
  • node scripts/run-oxlint.mjs --tsconfig tsconfig.oxlint.extensions.json extensions/feishu/src/monitor.account.ts extensions/feishu/src/sequential-key.ts extensions/feishu/src/sequential-key.test.ts extensions/matrix/src/approval-handler.runtime.test.ts

@openclaw-barnacle openclaw-barnacle Bot added channel: feishu Channel integration: feishu size: S labels Apr 27, 2026
@greptile-apps

greptile-apps Bot commented Apr 27, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR scopes the Feishu sequential queue key by group session to prevent long-running requests in one topic from blocking unrelated topics or senders in the same group. The new getFeishuSequentialKey implementation delegates to resolveFeishuGroupSession (the same function used by conversation routing) when the chat type is a group, and the feishuCfg is threaded through from monitorSingleAccount via a closure in registerEventHandlers.

Confidence Score: 5/5

Safe to merge — the fix is logically consistent with how conversation routing already scopes sessions, the key format matches test expectations, and backward compatibility (no feishuCfg) is preserved by falling back to the "group" scope default.

No P0 or P1 issues found. The logic correctly gates new scoping on group chat types, falls back gracefully when feishuCfg is absent, and reuses the same peerId logic already trusted by the session router. Test coverage is comprehensive for the three main scopes and per-group overrides.

No files require special attention.

Reviews (1): Last reviewed commit: "fix(feishu): scope sequential queue by g..." | Re-trigger Greptile

@clawsweeper

clawsweeper Bot commented Apr 30, 2026 •

Copy link
Copy Markdown
Contributor

Thanks for the context here. I swept through the related work, and this is now duplicate or superseded.

Keep this PR open: the Feishu queue/session direction is valid, but the current head is merge-conflicting, lacks required real Feishu behavior proof, and can still break same-topic FIFO for native topic starters whose thread id is hydrated only after queue selection.

Canonical path: Close this stale PR. The latest review rated it F, the branch still lacks merge-ready proof, and there has been no human follow-up after the durable review.

So I’m closing this here because the remaining work is already tracked in the canonical issue.

Review details

Best possible solution:

Close this stale PR. The latest review rated it F, the branch still lacks merge-ready proof, and there has been no human follow-up after the durable review.

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

Yes. Source-level review shows current main computes normal Feishu queue keys at account/chat scope while configured group_topic or group_topic_sender sessions can route by topic/sender identity; I did not run a live Feishu before-fix scenario in this read-only review.

Is this the best way to solve the issue?

No. Reusing Feishu group-session identity is the right direction, but this branch computes the queue key from the raw event before native topic hydration and lacks real behavior proof, so it is not the safest fix yet.

Security review:

Security review cleared: No concrete security or supply-chain issue was found; the diff adds no dependencies, workflows, secrets handling, auth, or network execution paths.

AGENTS.md: found and applied where relevant.

What I checked:

  • stale F-rated PR: PR was opened 2026-04-27T18:09:30Z, is older than 60 days, and the latest review rated it F.
  • proof blocker: real behavior proof is missing and proof tier is F, so this branch is not merge-ready without contributor follow-up.
  • no human follow-up: live comments and timeline hydrated by apply contain no non-automation activity after the ClawSweeper review.

Likely related people:

  • yfge: Commit 36d69d0 introduced sender/topic-scoped Feishu group session routing, which is the session identity this PR tries to reuse for queue keys. (role: feature introducer; confidence: high; commits: 36d69d05e212; files: extensions/feishu/src/bot.ts, extensions/feishu/src/bot.test.ts, extensions/feishu/src/config-schema.ts)
  • songyaolun: Commit f22fc17 added Feishu thread_id preference for topic session routing, directly adjacent to the om versus omt topic identity behavior involved here. (role: topic-routing contributor; confidence: high; commits: f22fc17c78c2; files: extensions/feishu/src/bot.ts, extensions/feishu/src/bot.test.ts, extensions/feishu/src/config-schema.ts)
  • ngutman: Commit 4b4ec4d added Feishu /btw out-of-band sequential lanes, an invariant this PR preserves while changing normal message queue lanes. (role: sequential-lane contributor; confidence: high; commits: 4b4ec4dbc298; files: extensions/feishu/src/sequential-key.ts, extensions/feishu/src/sequential-key.test.ts, extensions/feishu/src/sequential-queue.ts)
  • steipete: Commits bb5e278 and 8cc762d stabilized Feishu topic sessions and native topic hydration, the code path this PR must coordinate with before enqueueing. (role: recent adjacent contributor; confidence: high; commits: bb5e278f63bd, 8cc762daff13; files: extensions/feishu/src/bot-content.ts, extensions/feishu/src/bot.ts, extensions/feishu/src/bot.test.ts)

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

@AaronLuo00
AaronLuo00 force-pushed the fix/feishu-topic-sequential-key branch from cb1f8e2 to f70c4ec Compare May 1, 2026 16:08
@openclaw-barnacle openclaw-barnacle Bot removed the channel: matrix Channel integration: matrix label May 1, 2026
@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-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels May 30, 2026
@clawsweeper clawsweeper Bot added the rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. label May 30, 2026
@barnacle-openclaw barnacle-openclaw Bot removed the stale Marked as stale due to inactivity label May 30, 2026
@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 Jun 14, 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. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. and removed rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. labels Jun 14, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the stale Marked as stale due to inactivity label Jun 15, 2026
@clawsweeper

clawsweeper Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper applied the proposed close for this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: feishu Channel integration: feishu merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: S status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. 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.

1 participant