Skip to content

fix(gateway): restore native lint after transport changes - #157516

Merged
vincentkoc merged 1 commit into
mainfrom
fix/shared-gateway-error-details-20260924
Sep 24, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
fix/shared-gateway-error-details-20260924

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

Related: #147070, #157454, #157457

What Problem This Solves

Fixes native CI failing its existing SwiftLint file-length limit after the shared gateway transport changes landed.

User Impact

No user-visible behavior changes. This restores native validation for the next small mobile pairing PR without weakening the lint limit or changing authentication behavior.

Why This Change Was Made

GatewayChannel.swift reached 1,512 counted lines against the existing 1,500-line limit. Move its 22-line error-detail conversion function into the existing GatewayErrors.swift owner. Both connection and request-response callers keep using the same function and error-field precedence. The moved function remains module-internal; no public API changes.

Production delta: +22/-22 (net zero); tests: unchanged. No new files, configuration, dependencies, migrations, or desktop application changes.

Evidence

  • Observed failure: https://github.com/openclaw/openclaw/actions/runs/36045607827/job/107788630238 (GatewayChannel.swift file-length violation).
  • Focused strict SwiftLint 0.65.0 passes for both changed files with the iOS configuration. The exact-head iOS CI job also passed the pinned SwiftLint 0.65.1 check.
  • SwiftFormat 0.63.0 and git diff --check pass.
  • Independent review found no actionable P0-P2 issues; checked both callers, protocol type identity, visibility, and error-detail precedence. Compilation was not independently verified by that review.
  • Native package job passed on a0923d39b1a7cc0c8733ac330dd8cbc7321f1075: 1,792 tests across 141 suites in 36.444 seconds, including Gateway errors and Gateway session coverage. It tested merge 217b51cf03e66a95144066c9a9c1185a93634bb6 with main 37783fcbcf78c93c09caf743e0ba53ed44dbfedf.
  • ClawSweeper found no actionable correctness or security findings and no remaining pre-merge items: fix(gateway): restore native lint after transport changes #157516 (comment).
  • Required CI passed for this head, including iOS debug/release builds, voice/lifecycle/Watch simulator coverage, macOS tests, Android checks, and openclaw/ci-gate. The separate inherited Periphery finding is documented below.

Known baseline follow-up: shared Periphery intersection reports only GatewayExternalAuthorizationError, introduced by #157454. Its GatewayConnectionProblem.swift blob is identical on this branch and the main baseline (ce5ffbb9441cd4aea2b9d9f9f8137070f64c9294); this PR changes neither that type nor its admission/reconnect consumers. The global scan includes all shared declarations, so it exposes the staged error type before its app producer lands. Resolve that retention/activation decision with the staged mobile ingress work; this repair adds no suppression and preserves the existing transport contract.

@vincentkoc vincentkoc self-assigned this Sep 24, 2026
@clawsweeper

clawsweeper Bot commented Sep 24, 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.

@vincentkoc
vincentkoc marked this pull request as ready for review September 24, 2026 19:17
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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 Sep 24, 2026
@clawsweeper

clawsweeper Bot commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 24, 2026, 3:21 PM ET / 19:21 UTC.

ClawSweeper review

What this changes

Moves Apple Gateway error-detail conversion into the shared error module so native lint can pass while connection and request errors keep the same fields.

Merge readiness

✅ Ready for maintainer review

Keep open: the native lint problem remains on the pinned current main, and this branch is a focused repair. Source review found no concrete correctness or security defect.

Priority: P3
Reviewed head: a0923d39b1a7cc0c8733ac330dd8cbc7321f1075

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The narrow move preserves the inspected error conversion behavior and has focused lint evidence, with native CI still pending at capture.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: The member-authored patch changes the location of the Apple Gateway error converter, which both production failure paths still call. The PR reports a focused strict native lint pass; exact-head native compilation was pending in the captured context. No stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The member-authored patch changes the location of the Apple Gateway error converter, which both production failure paths still call. The PR reports a focused strict native lint pass; exact-head native compilation was pending in the captured context. No stored-data contract changes.
Evidence reviewed 5 items Introduced patch: The pinned PR delta removes the 22-line converter from the channel and adds the same field precedence in the existing error module, using the same OpenClawProtocol.AnyCodable type.
Current-main necessity: The pinned current main still defines the converter in GatewayChannel.swift; comparison with the PR head shows the relocation has not landed.
Existing callers: Connection rejection and request-response failure both call the moved converter; neither call site changes in the introduced patch.
Findings None None.
Security None None.

How this fits together

OpenClawKit's Apple Gateway channel receives Gateway responses and turns failures into connection or request errors. The error-detail converter carries the server's fields into those errors for app handling.

flowchart LR
A[Gateway response] --> B[Apple Gateway channel]
B --> C[Error detail conversion]
C --> D{Failure type}
D --> E[Connection error]
D --> F[Request error]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Other 0. Total 0 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 2 22 22 0
Total 2 22 22 0

Review metrics

None.

Technical review

Best possible solution:

Keep error-detail conversion in the shared error module, with native lint passing and connection and request error fields preserved.

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

Yes. The linked native CI failure, the 1,500-line SwiftLint threshold, and the pre-fix helper location give a focused reproduction path; this read-only review did not rerun SwiftLint.

Is this the best way to solve the issue?

Yes. Moving the converter to the existing error owner preserves both callers and their field precedence without weakening the lint rule.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This is a small native validation repair with no stated user-visible behavior change.
  • 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. Not applicable: The member-authored patch changes the location of the Apple Gateway error converter, which both production failure paths still call. The PR reports a focused strict native lint pass; exact-head native compilation was pending in the captured context. No stored-data contract changes.

Label justifications:

  • P3: This is a small native validation repair with no stated user-visible behavior change.
  • 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. Not applicable: The member-authored patch changes the location of the Apple Gateway error converter, which both production failure paths still call. The PR reports a focused strict native lint pass; exact-head native compilation was pending in the captured context. No stored-data contract changes.

Evidence

What I checked:

Likely related people:

  • vincentkoc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Gio Della-Libera: 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.

@vincentkoc
vincentkoc enabled auto-merge (squash) September 24, 2026 19:24
@vincentkoc
vincentkoc merged commit dce20e8 into main Sep 24, 2026
138 of 139 checks passed
@vincentkoc
vincentkoc deleted the fix/shared-gateway-error-details-20260924 branch September 24, 2026 19:44
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash auto-merge.

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

Labels

P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS 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