Skip to content

fix(feishu): preserve custom HTTPS domain ports - #117278

Merged
steipete merged 1 commit into
mainfrom
codex/qa400-feishu-custom-https-domain-port
Aug 1, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/qa400-feishu-custom-https-domain-port

Conversation

@steipete

@steipete steipete commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where Feishu operators using a documented custom HTTPS API domain with an explicit port could not send messages, read messages, or inspect chats because the upstream SDK interpreted the domain port as a missing API route argument.

Why This Change Was Made

The Feishu client owner now gives the SDK its canonical port-free domain during route expansion while its existing account-owned HTTP transport restores the operator's exact HTTPS origin, explicit port, and optional reverse-proxy path for every request. The same canonical transport serves REST authentication, all HTTP methods, Drive calls, media uploads, and WebSocket endpoint discovery; no configuration, dependency, plugin SDK, authentication policy, or other plugin changes.

User Impact

Private Feishu deployments using HTTPS domains such as https://feishu.example:8443/company can send messages, read message/chat context, upload media, access Drive, and initialize WebSockets without losing their configured port or path. Official Feishu/Lark domains, per-account isolation, existing proxies, timeout behavior, and unrelated request origins remain unchanged.

Evidence

  • Immutable reviewed head: d2e4c6509f4e059465664a79383a30c65c65a17a; tree: 199de5d07fff2296a93e03115b567cbab7042f20; base: ad3e36ef33148ea5b341ebbbc8f5b0fcd84b0596; current main: 8ed6c98b08f47b0c1a35335b8faa8bb2601de9bb; clean synthetic merge tree: e61c2dc2145b4927fbc11e893429620df42b8232.
  • Before the refactor, 13 focused custom-domain regression cases failed and the actual installed @larksuiteoapi/[email protected] reported request miss <port> path argument for real message send, message read, and chat read.
  • After the refactor, five focused owner/sibling test files and all 96 tests passed, covering the client, Drive, streaming cards, actual direct-message loopback, and actual message-content loopback.
  • A genuine local HTTPS server, custom explicit port, reverse-proxy prefix, actual installed SDK, and authenticated requests independently passed tenant-token acquisition, message send, message read, chat read, direct Drive access, and WebSocket endpoint discovery; every request remained scoped to the configured HTTPS origin and path.
  • Focused cases additionally verify every SDK HTTP verb, multipart normalization before URL rewriting, per-account origin isolation, official Feishu/Lark numeric SDK domains, exact-origin spoof rejection, proxy behavior, and unchanged timeouts.
  • Formatting, focused lint, and git diff --check passed on the immutable head; independent hostile owner reviews and the fresh complete-branch P0–P3 autoreview are recorded in the landing manifest.

@openclaw-barnacle openclaw-barnacle Bot added channel: feishu Channel integration: feishu size: M maintainer Maintainer-authored PR labels Aug 1, 2026
@clawsweeper clawsweeper Bot added 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. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. labels Aug 1, 2026
@clawsweeper

clawsweeper Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 1, 2026, 3:29 AM ET / 07:29 UTC.

ClawSweeper review

What this changes

This PR changes the Feishu plugin’s HTTP transport so configured custom HTTPS origins retain their explicit port and reverse-proxy path after the Lark SDK expands API routes.

Merge readiness

⚠️ Ready for maintainer review - 4 items remain

Keep this PR open for explicit maintainer review. Current main still passes a custom HTTPS domain directly to the Lark SDK, while this patch moves the custom-origin restoration into the Feishu-owned transport; the change appears coherent and the submitted proof is substantial, but the checkout has no installed or cached SDK source and network resolution prevented an independent dependency-contract read.

Priority: P2
Reviewed head: d2e4c6509f4e059465664a79383a30c65c65a17a
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-boundary repair with broad targeted coverage and credible live HTTPS evidence; final confidence is limited only by unavailable independent inspection of the pinned SDK source.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): The PR body records an after-fix run against a genuine local HTTPS server with an explicit port and reverse-proxy prefix across token, message, chat, Drive, and WebSocket-discovery requests; the dedicated Real behavior proof check also succeeded.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The PR body records an after-fix run against a genuine local HTTPS server with an explicit port and reverse-proxy prefix across token, message, chat, Drive, and WebSocket-discovery requests; the dedicated Real behavior proof check also succeeded.
Evidence reviewed 8 items Current-main behavior remains unfixed: The provided current-main commit still returns a custom configured domain directly from resolveDomain and passes it to both SDK client constructors, so it does not contain this transport-level repair.
Patch keeps origin ownership in the Feishu transport: The proposed client passes the SDK its canonical Feishu domain, then rewrites only SDK requests whose origin is https://open.feishu.cn to the configured custom HTTPS origin, retaining the configured port, prefix, query, and hash.
Client and WebSocket paths share the repair: Both the normal SDK client and WebSocket client receive resolveSdkDomain(domain) plus a custom-domain-aware HTTP instance, covering REST requests and WebSocket endpoint discovery through one transport owner.
Findings None None.
Security None None.

How this fits together

The Feishu plugin creates per-account SDK and WebSocket clients for sending, reading, uploading, and receiving channel data. SDK-generated API URLs enter the plugin-owned HTTP transport, which applies timeout, proxy, multipart, and now custom-origin handling before requests leave OpenClaw.

flowchart LR
  A[Feishu account configuration] --> B[Client and WebSocket creation]
  B --> C[Lark SDK route expansion]
  C --> D[Plugin HTTP transport]
  D --> E[Custom-origin decision]
  E --> F[HTTPS API, Drive, and WebSocket discovery]
  D --> G[Timeout and proxy handling]
Loading

Decision needed

Question Recommendation
Should this PR land with the canonical-domain-plus-transport-rewrite approach after the remaining exact-head checks complete, despite the unavailable independent SDK-source inspection in this environment? Accept the transport-owner repair: Land after required checks complete, relying on the focused tests and real HTTPS-server evidence recorded in the PR body.

Why: The implementation deliberately depends on upstream SDK URL expansion behavior, and this PR carries the protected maintainer label; that final compatibility judgment cannot safely be inferred from mocked source tests alone.

Before merge

  • Resolve merge risk (P1) - The repair depends on the installed Lark SDK continuing to generate absolute official-Feishu request URLs for its injected HTTP instance; direct SDK-source inspection was blocked by absent package contents and unavailable network.
  • Resolve merge risk (P1) - The PR is protected by the maintainer label, so explicit human landing judgment remains required even though no source-level defect was found.
  • Complete next step (P2) - The protected maintainer label and remaining upstream SDK-contract confirmation require explicit human landing review; no bounded repair task is currently indicated.
Agent review details

Security

None.

PR surface

Source +27, Tests +143. Total +170 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 47 20 +27
Tests 1 149 6 +143
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 196 26 +170

Review metrics

None.

Merge-risk options

Maintainer options:

  1. Verify the SDK URL boundary before merge (recommended)
    Confirm the pinned SDK continues to pass absolute official-domain URLs into the injected transport, then land the single canonical rewrite path.
  2. Accept the documented proof
    A maintainer may accept the PR body’s real HTTPS-server result and focused regression suite as sufficient evidence for the pinned dependency behavior.
  3. Pause for a narrower dependency upgrade path
    Pause this PR if the SDK URL contract cannot be independently confirmed and a dependency-supported custom-domain API is preferred.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Obtain or attach focused pinned-SDK URL-boundary evidence for custom-domain request rewriting, then rerun exact-head review.

Technical review

Best possible solution:

Keep one Feishu-owned URL-rewrite path, retain the existing configured HTTPS-domain contract, and land only after a maintainer accepts the SDK-contract evidence and the exact-head required checks complete.

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

Yes, source-reproducible: current main passes a configured HTTPS URL directly to the SDK while the PR documents the resulting port-as-route failure and adds focused custom-origin transport cases. I did not execute the live reproduction in this read-only checkout.

Is this the best way to solve the issue?

Yes, provisionally: preserving the SDK’s canonical route expansion while restoring the operator-owned origin in the existing Feishu HTTP transport keeps timeout, proxy, multipart, REST, Drive, and WebSocket-discovery behavior on one owner path; the remaining uncertainty is the upstream SDK URL contract.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P2: This is a bounded channel regression for private Feishu deployments rather than a broad default-path outage.
  • add merge-risk: 🚨 compatibility: The patch changes how an existing documented custom-domain setting is interpreted across SDK client and WebSocket initialization.
  • add merge-risk: 🚨 message-delivery: The modified transport carries Feishu send, read, upload, and chat requests, so a URL-rewrite error could prevent or misroute channel operations.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body records an after-fix run against a genuine local HTTPS server with an explicit port and reverse-proxy prefix across token, message, chat, Drive, and WebSocket-discovery requests; the dedicated Real behavior proof check also succeeded.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR body records an after-fix run against a genuine local HTTPS server with an explicit port and reverse-proxy prefix across token, message, chat, Drive, and WebSocket-discovery requests; the dedicated Real behavior proof check also succeeded.

Label justifications:

  • P2: This is a bounded channel regression for private Feishu deployments rather than a broad default-path outage.
  • merge-risk: 🚨 compatibility: The patch changes how an existing documented custom-domain setting is interpreted across SDK client and WebSocket initialization.
  • merge-risk: 🚨 message-delivery: The modified transport carries Feishu send, read, upload, and chat requests, so a URL-rewrite error could prevent or misroute channel operations.
  • 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 (terminal): The PR body records an after-fix run against a genuine local HTTPS server with an explicit port and reverse-proxy prefix across token, message, chat, Drive, and WebSocket-discovery requests; the dedicated Real behavior proof check also succeeded.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body records an after-fix run against a genuine local HTTPS server with an explicit port and reverse-proxy prefix across token, message, chat, Drive, and WebSocket-discovery requests; the dedicated Real behavior proof check also succeeded.

Evidence

What I checked:

  • Current-main behavior remains unfixed: The provided current-main commit still returns a custom configured domain directly from resolveDomain and passes it to both SDK client constructors, so it does not contain this transport-level repair. (extensions/feishu/src/client.ts:263, edfeec49e7a7)
  • Patch keeps origin ownership in the Feishu transport: The proposed client passes the SDK its canonical Feishu domain, then rewrites only SDK requests whose origin is https://open.feishu.cn to the configured custom HTTPS origin, retaining the configured port, prefix, query, and hash. (extensions/feishu/src/client.ts:264, d2e4c6509f4e)
  • Client and WebSocket paths share the repair: Both the normal SDK client and WebSocket client receive resolveSdkDomain(domain) plus a custom-domain-aware HTTP instance, covering REST requests and WebSocket endpoint discovery through one transport owner. (extensions/feishu/src/client.ts:377, d2e4c6509f4e)
  • Configured-domain contract: Feishu configuration already accepts either the official domain selectors or an HTTPS URL, establishing custom HTTPS domains as an existing supported behavior rather than a new configuration surface. (extensions/feishu/src/config-schema.ts:26, 7aacd1314d71)
  • Focused regression coverage: The branch expands the client tests around custom-origin rewriting, including SDK HTTP verbs, multipart requests, origin isolation, official-domain behavior, proxy handling, and WebSocket construction. (extensions/feishu/src/client.test.ts:278, d2e4c6509f4e)
  • Feature-history routing: The current transport and domain path is attributable to recent Feishu client work; the local history identifies Vincent Koc’s ambient-proxy transport repair and Peter Steinberger’s prior Feishu client contributions. (extensions/feishu/src/client.ts:263, d43c8ec7a255)

Likely related people:

  • Vincent Koc: Recent history includes the Feishu ambient-proxy transport repair that owns the HTTP-instance behavior this PR extends. (role: recent area contributor; confidence: high; commits: d43c8ec7a255, 42c313976ef0; files: extensions/feishu/src/client.ts)
  • steipete: Peter Steinberger has multiple prior commits on the current Feishu client path and authored the proposed repair. (role: prior Feishu client contributor; confidence: high; commits: eb60b2208cf8, d2e4c6509f4e; files: extensions/feishu/src/client.ts, extensions/feishu/src/client.test.ts)
  • Yifeng Wang: Feature history attributes the multi-account Feishu client foundation to Yifeng Wang, making this a related ownership route for account-scoped domain behavior. (role: feature introducer; confidence: medium; commits: 5f6e1c19bd18; files: extensions/feishu/src/client.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Attach or retain a concise pinned-SDK URL-boundary trace if maintainers want to eliminate the remaining dependency-contract uncertainty before merge.

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.

@steipete
steipete merged commit a1f2fb4 into main Aug 1, 2026
102 of 116 checks passed
@steipete
steipete deleted the codex/qa400-feishu-custom-https-domain-port branch August 1, 2026 08:00
@steipete

steipete commented Aug 1, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Aug 1, 2026
* origin/main: (41 commits)
  test(ci): update memory helper routing expectation (#117295)
  fix(canvas): emit successful control results in JSON mode (#117297)
  fix(imessage): settle native inbound reply delivery (#117282)
  fix(agents): reject invalid UTF-8 LSP responses (#117271)
  fix(line): centralize card and template message alt text (#117280)
  fix(release): validate candidates before Docker publication (#117252)
  fix(media): validate provider-owned generated media downloads (#117281)
  fix(feishu): restore custom HTTPS API domains (#117278)
  fix(models): reuse prepared plugin metadata (#117131)
  fix(agents): stop fallback after delivered-but-failed attempts (#114628)
  fix(memory): reuse targeted session corpus snapshot (#117247)
  fix(matrix): reconcile durable sends after response loss
  test(release): repair full validation regressions (#116931)
  fix(linux-canvas): report socket watcher fallback (#109502)
  fix(codex): preserve authoritative turn completion (#117185)
  fix(canvas): preserve widgets across derived-name collisions (#117132)
  fix(channels): config validation rejects documented channels.<id>.configWrites on 13 channels (#117206)
  fix(msteams): prevent duplicate final replies (#116398)
  fix(doctor): session SQLite restore installs an empty session index over the valid archive (#117221)
  fix(plugins): preserve workspace plugins across CLI and control UI (#117265)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 2, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 2, 2026
* origin/main: (41 commits)
  test(ci): update memory helper routing expectation (openclaw#117295)
  fix(canvas): emit successful control results in JSON mode (openclaw#117297)
  fix(imessage): settle native inbound reply delivery (openclaw#117282)
  fix(agents): reject invalid UTF-8 LSP responses (openclaw#117271)
  fix(line): centralize card and template message alt text (openclaw#117280)
  fix(release): validate candidates before Docker publication (openclaw#117252)
  fix(media): validate provider-owned generated media downloads (openclaw#117281)
  fix(feishu): restore custom HTTPS API domains (openclaw#117278)
  fix(models): reuse prepared plugin metadata (openclaw#117131)
  fix(agents): stop fallback after delivered-but-failed attempts (openclaw#114628)
  fix(memory): reuse targeted session corpus snapshot (openclaw#117247)
  fix(matrix): reconcile durable sends after response loss
  test(release): repair full validation regressions (openclaw#116931)
  fix(linux-canvas): report socket watcher fallback (openclaw#109502)
  fix(codex): preserve authoritative turn completion (openclaw#117185)
  fix(canvas): preserve widgets across derived-name collisions (openclaw#117132)
  fix(channels): config validation rejects documented channels.<id>.configWrites on 13 channels (openclaw#117206)
  fix(msteams): prevent duplicate final replies (openclaw#116398)
  fix(doctor): session SQLite restore installs an empty session index over the valid archive (openclaw#117221)
  fix(plugins): preserve workspace plugins across CLI and control UI (openclaw#117265)
  ...
chovizzz added a commit to chovizzz/openclaw that referenced this pull request Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: feishu Channel integration: feishu maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. 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.

1 participant