fix(feishu): preserve quoted reply ancestry - #66207
Conversation
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: Approved
Fix preserves multi-level quoted reply ancestry for Feishu by following parent_id/upper_message_id chains up to 6 levels deep, staying within the 500-character budget. The shared LRU message-item cache avoids duplicate API calls. Cycle protection and chat/thread boundary guards are appropriate. Comprehensive test coverage (265 lines). No security issues.
|
Thanks for the focused Feishu reply-context fix. Current main resolves one reply target and fetches only that message ( The related discussion was considered: #36233 concerns quote-versus-topic routing, while this change is limited to reply-context ancestry. The PR base versions of both changed files match current main, so the change should salvage mechanically without adapting to later main changes. Automated hermes-sweeper review. |
bc9506c to
9fcb9f0
Compare
SummaryTwo open PRs address #67184 by adding bounded Feishu quoted-reply ancestry traversal through the existing reply_to_text path. Both follow parent/root links with depth, size, cycle, lookup, chat, and thread guards, but #67222 retains an Optional-text slicing defect that #66207 avoids. Related pull requests
Duplicates#67222 is substantially a duplicate of #66207: both modify the same adapter and test paths for the same bounded Feishu ancestry, cache, and reply-context mechanism, while #66207 has the safer rendering path and cache-reuse regression. Suggested consolidationKeep #66207 open with a salvage path: retain its null-safe bounded traversal, shared cache, and regression coverage, consistent with the maintainer-bot keep_open verdict and the recorded best-fix selection. Close #67222 as a duplicate of #66207 because its overlapping implementation retains the contributor-reviewed Optional-text slicing defect. Complex graphflowchart LR
classDef open fill:#dbeafe,stroke:#1d4ed8,color:#1e3a8a
classDef merged fill:#dcfce7,stroke:#15803d,color:#14532d
classDef closed fill:#e5e7eb,stroke:#6b7280,color:#1f2937
classDef unverified fill:#f3f4f6,stroke:#9ca3af,color:#374151
classDef best stroke-width:3px,stroke:#b45309
classDef target stroke-width:3px,stroke:#4338ca
I67184(["issue #67184 (open)"])
subgraph Dup66207 ["PRs duplicating each other"]
P66207["PR #66207 (open)"]
P67222["PR #67222 (open)"]
end
P66207 -->|best fix| I67184
class I67184 open
class P66207 open
class P67222 open
class P66207 best
class P66207 target
click I67184 "https://github.com/NousResearch/hermes-agent/issues/67184"
click P66207 "https://github.com/NousResearch/hermes-agent/pull/66207"
click P67222 "https://github.com/NousResearch/hermes-agent/pull/67222"
Graph: solid arrow = fixes / best fix, dashed arrow = partial or unverified (see edge label); boxed group = PRs duplicating each other; amber border = best fix; indigo border = target; gray node = closed (state tag in the node label). Cross-PR triage: Reviewed 2 pull requests and 1 issue in this complex. Each diff was read against this issue; Assessment working set: 38 kB of PR diffs, 8 kB of issue/PR text, 2 kB of discussion (5 comments), 3 verify verdicts. verdicts reflect diff content, not PR titles. Part of an automated triage batch. |
What does this PR do?
Feishu quote replies currently fetch only the direct parent text. When that parent is itself a reply, short follow-ups such as “this one” or “agree” lose the original question that gives the parent its meaning.
This change follows the explicit
parent_id/upper_message_idancestry for quoted messages and supplies a bounded text chain through the existingreply_to_textfield.Related Issue
Fixes #67184.
This is intentionally separate from quote/topic routing in #36233 and replied-attachment handling in #54570.
Type of Change
Changes Made
plugins/platforms/feishu/adapter.pyparent_id,upper_message_id, and root-only ancestry while retaining cycle protection.tests/gateway/test_feishu.pyHow to Test
main, run the new focused tests and observe that the ancestry method is missing and nested quotes expose only the direct parent..venv/bin/python -m pytest tests/gateway/test_feishu.py -o 'addopts=' -q— 221 passed..venv/bin/python -m pytest tests/gateway/test_reply_to_injection.py -o 'addopts=' -q— 6 passed..venv/bin/ruff check .— passed..venv/bin/python -m py_compile plugins/platforms/feishu/adapter.py tests/gateway/test_feishu.pyandgit diff --check— passed.Checklist
Code
pytest tests/ -qsuitelark-oapi==1.6.8Documentation & Housekeeping
cli-config.yaml.exampleupdate — N/ACONTRIBUTING.md/AGENTS.mdupdate — N/AScreenshots / Logs
Not applicable. The behavior is covered by deterministic adapter and gateway regression tests.