Skip to content

fix(feishu): retain API diagnostics for rejected tool requests - #166599

Merged
altaywtf merged 5 commits into
openclaw:mainfrom
rudycelekli:campaign/openclaw-feishu-diagnostics-20261007
Oct 8, 2026
Merged

altaywtf merged 5 commits into
openclaw:mainfrom
rudycelekli:campaign/openclaw-feishu-diagnostics-20261007

Conversation

@rudycelekli

@rudycelekli rudycelekli commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Related: #132481

What Problem This Solves

Fixes: Rejected Feishu document requests hide API diagnostics behind generic HTTP errors.

User Impact

Operators now see business error codes, messages and request log IDs.

Why This Change Was Made

flowchart LR
  A[Rejected SDK request] --> B[Select diagnostic fields]
  B --> C[Redact and fence content]
  C --> D[Tool error result]
Loading

Request credentials stay excluded; ordinary errors retain their result shape.

Evidence

  • Native SDK/tool proof fails before the fix and passes afterward, including success, validation, Drive and security controls.
  • Synthetic loopback proof; authenticated Feishu permissions, token lifecycle and Sheets behavior remain unverified.

@clawsweeper

clawsweeper Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added channel: feishu Channel integration: feishu size: M labels Oct 7, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 7, 2026
@clawsweeper

clawsweeper Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 7, 2026, 4:46 PM ET / 20:46 UTC (Revision 4).

ClawSweeper review

What this changes

The Feishu plugin preserves redacted API error codes, messages, and request log IDs in rejected tool results, with document and Drive regression coverage.

Merge readiness

✅ Ready for maintainer review

This PR remains useful: current main and the latest release still lose diagnostics from rejected Feishu SDK requests. The focused repair has credible production-boundary proof, and no blocking defect was found.

Priority: P2
Reviewed head: 4d07bfa0651d740930377f2f42ef41db27d65dde

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with meaningful SDK-boundary regression proof and no supported blocking finding.
Proof confidence 🐚 platinum hermit (4/6) ✨ media proof bonus Sufficient (linked_artifact): The registered document tool and installed SDK exercise a rejected conversion over real loopback HTTP; the exact-head linked run requires baseline failure and reports candidate and sibling success. This proves the changed diagnostic boundary, while authenticated Feishu permissions and token recovery remain outside the claim. Raw logs were proxy-blocked, but workflow source, step outcomes, and candidate artifact identity were verified.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (linked_artifact): The registered document tool and installed SDK exercise a rejected conversion over real loopback HTTP; the exact-head linked run requires baseline failure and reports candidate and sibling success. This proves the changed diagnostic boundary, while authenticated Feishu permissions and token recovery remain outside the claim. Raw logs were proxy-blocked, but workflow source, step outcomes, and candidate artifact identity were verified.
Evidence reviewed 9 items Pinned introduced change: The merge-base-to-head diff changes only the Feishu error handler and its three regression-test files. The host-verified test merge also confines the resulting change to those paths.
Still necessary on main and latest release: Both fetched main and the supplied v2026.9.8 release retain the handler that calls only formatErrorMessage(error), without extracting response.data diagnostics. No merged fixing PR was established.
Release comparison: The latest release has the same generic error handler, so this diagnostic repair is not already shipped there.
Findings None None.
Security None None.

How this fits together

Feishu document and Drive tools send requests through the Lark SDK. Their shared error handler turns rejected requests into structured tool results and fenced text for the agent.

flowchart LR
  A[Document or Drive tool] --> B[Lark SDK request]
  B --> C[Rejected API response]
  C --> D[Select diagnostic fields]
  D --> E[Redact sensitive text]
  E --> F[Structured error and fenced agent text]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +25, Tests +189. Total +214 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 1 26 1 +25
Tests 3 190 1 +189
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 216 2 +214

Review metrics

Metric Value Why it matters
Production versus regression growth production +25 net lines; tests +189 net lines The production growth selects safe diagnostics in the existing owner, while most added code exercises SDK transport and security controls.

Technical review

Best possible solution:

Keep one shared Feishu error handler that exposes safe vendor diagnostics while preserving redaction, fencing, and ordinary error behavior.

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

Yes, from source: a rejected SDK Error carrying response.data reaches a current-main handler that formats only the generic error message. The linked before/after harness exercises that failure through the production document tool and real SDK HTTP client.

Is this the best way to solve the issue?

Yes. Reusing the existing Feishu formatter with a restricted field projection is a narrow repair that avoids another diagnostic implementation.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against b1697e2ae8f6.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This repairs bounded Feishu troubleshooting friction without evidence of an urgent runtime or delivery regression.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (linked_artifact): The registered document tool and installed SDK exercise a rejected conversion over real loopback HTTP; the exact-head linked run requires baseline failure and reports candidate and sibling success. This proves the changed diagnostic boundary, while authenticated Feishu permissions and token recovery remain outside the claim. Raw logs were proxy-blocked, but workflow source, step outcomes, and candidate artifact identity were verified.
  • proof: sufficient: Contributor real behavior proof is sufficient. The registered document tool and installed SDK exercise a rejected conversion over real loopback HTTP; the exact-head linked run requires baseline failure and reports candidate and sibling success. This proves the changed diagnostic boundary, while authenticated Feishu permissions and token recovery remain outside the claim. Raw logs were proxy-blocked, but workflow source, step outcomes, and candidate artifact identity were verified.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • m1heng: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (3 earlier review cycles)
  • reviewed 2026-10-07T13:35:19.330Z sha 4d07bfa :: needs maintainer review before merge. :: none
  • reviewed 2026-10-07T13:46:14.061Z sha 4d07bfa :: needs maintainer review before merge. :: none
  • reviewed 2026-10-07T14:13:06.104Z sha 4d07bfa :: needs maintainer review before merge. :: none

@altaywtf
altaywtf merged commit 642ac2f into openclaw:main Oct 8, 2026
131 of 132 checks passed
@altaywtf

altaywtf commented Oct 8, 2026

Copy link
Copy Markdown
Member

Merged via squash.

MarMarLabs added a commit to MarMarLabs/openclaw that referenced this pull request Oct 8, 2026
14 upstream commits. openclaw#166818 removes low-value tests across several
areas, including seven Feishu test files. In
extensions/feishu/src/send.test.ts it deletes the test that checked a
send works without the Feishu runtime text helpers and moves that
condition into beforeEach for every test in the file. This branch had
changed one line in that deleted test, adding the accountId the send now
passes to resolveMarkdownTableMode, so the two sides conflicted.

The merge follows upstream's pruning and takes upstream's send.test.ts.
The accountId forwarding is still covered by this branch's
send.markdown-tables.test.ts, which checks the posted text for a named
account and for the channel default rather than the arguments of a mock.
openclaw#166599 changes extensions/feishu/src/tool-result.ts and adds tests, and
merged without conflict. Every Feishu file this merge changes is
identical to upstream/main, and every other file is the same as the
previous branch head.

Upstream did not change the config baseline in this range. The merge
took upstream's generated files and regenerated all three from this
merge with build:docker in a separate detached checkout. Counts are core
2495, channel 3876 and plugin 4527, the same as the previous branch
head, and every hash matches it. The generated metadata differs from
upstream/main only by the two Feishu markdown.tables entries. The three
generated-file checks pass there.

Feishu: 102 files and 1502 tests in the extension project, 17 files and
217 tests in the database-workers project, all passing. The drop from
1523 and 218 is the tests openclaw#166818 removed less the ones openclaw#166599 added.
The forwarder test and the routing guards pass, 503 tests. tsgo:core,
tsgo:extensions, tsgo:extensions:test, tsgo:test:root, the line-cap,
max-lines, assertion-safety, database-worker, test-timeout-race and
test-mock-exports ratchets against upstream/main, oxlint with
unused-directive errors and oxfmt on the 42 changed code files all pass.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 8, 2026
…law#166599)

* test(feishu): reproduce document diagnostic loss through SDK

Signed-off-by: Rudy Celekli <[email protected]>

* fix(feishu): preserve safe document API rejection diagnostics

Signed-off-by: Rudy Celekli <[email protected]>

* test(feishu): require retained Drive error diagnostics

Signed-off-by: Rudy Celekli <[email protected]>

* test(feishu): forward native SDK HTTP generics correctly

Signed-off-by: Rudy Celekli <[email protected]>

* test(feishu): use contextual SDK request typing

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: feishu Channel integration: feishu P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants