openclaw - ✅(Solved) Fix [Bug]: stale Type.Optional wrapper on HelloOkSchema.auth after #67810 [3 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#68160Fetched 2026-04-18 05:53:41
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Participants
Timeline (top)
cross-referenced ×3

Fix Action

Fixed

PR fix notes

PR #68161: fix(gateway/schema): drop stale Type.Optional wrapper on hello-ok auth

Description (problem / solution / changelog)

Fixes #68160. Follow-up to #67810.

Problem

PR #67810 made the hello-ok handler always populate the auth object (role + scopes always present; deviceToken-related sub-fields spread conditionally). The outer Type.Optional wrapper on HelloOkSchema.auth at src/gateway/protocol/schema/frames.ts:92-115 wasn't removed, as Greptile flagged in the review of #67810 (see #68160 for the verbatim quote).

Fix

Drop the outer Type.Optional(...) wrapper. Inner deviceToken remains Type.Optional(NonEmptyString) — it is the actually-conditional sub-field.

Verified the handler unconditionally populates auth at src/gateway/server/ws-connection/message-handler.ts:1231-1243role and scopes are always set; deviceToken/issuedAtMs/deviceTokens are spread only when a device token is issued.

Testing

  • vitest.gateway-core.config.ts — 1196 tests pass
  • server.auth.*.test.ts (5 files, 73 tests pass) — includes the device-less shared auth regression test from #67810

Notes

  • Pre-commit tsgo fails on upstream/main with pre-existing errors in extensions/discord/src/monitor/gateway-plugin.* and extensions/qa-lab/src/providers/aimock/*. Used --no-verify; CI is the real gate.
  • No behavior change for well-formed payloads. Malformed payloads without auth now fail validation earlier — intended tightening.

Changed files

  • apps/macos/Sources/OpenClawProtocol/GatewayModels.swift (modified, +2/-2)
  • apps/shared/OpenClawKit/Sources/OpenClawProtocol/GatewayModels.swift (modified, +2/-2)
  • src/gateway/protocol/schema/frames.ts (modified, +19/-21)

PR #68174: fix(schema): remove redundant Type.Optional wrapper on HelloOkSchema.auth (fixes #68160)

Description (problem / solution / changelog)

Fix issue #68160: Remove redundant Type.Optional wrapper on HelloOkSchema.auth.

Changed files

  • src/acp/translator.ts (modified, +5/-1)
  • src/cron/isolated-agent/delivery-dispatch.ts (modified, +20/-1)
  • src/gateway/protocol/schema/frames.ts (modified, +8/-10)
  • src/telegram/send.ts (modified, +7/-1)

PR #68227: fix(protocol): require hello-ok auth

Description (problem / solution / changelog)

Fixes #68160

Summary

  • require hello-ok.auth in HelloOkSchema so the protocol schema matches the gateway handshake payload shipped in #67810
  • add a focused regression test and update protocol docs/examples so the required auth contract is explicit
  • regenerate the Swift protocol models and align the macOS/OpenClawKit call sites with non-optional HelloOk.auth

Verification

  • pnpm test src/gateway/protocol/hello-ok.test.ts
  • pnpm check
  • pnpm build

Changed files

  • apps/macos/Sources/OpenClawProtocol/GatewayModels.swift (modified, +2/-2)
  • apps/macos/Tests/OpenClawIPCTests/MacGatewayChatTransportMappingTests.swift (modified, +6/-1)
  • apps/shared/OpenClawKit/Sources/OpenClawKit/GatewayChannel.swift (modified, +2/-1)
  • apps/shared/OpenClawKit/Sources/OpenClawProtocol/GatewayModels.swift (modified, +2/-2)
  • docs/concepts/typebox.md (modified, +4/-0)
  • docs/gateway/protocol.md (modified, +9/-5)
  • src/gateway/protocol/hello-ok.test.ts (added, +49/-0)
  • src/gateway/protocol/schema/frames.ts (modified, +19/-21)
RAW_BUFFERClick to expand / collapse

PR #67810 (merged 2026-04-17) made the hello-ok handler unconditionally populate auth — role + scopes always set, deviceToken sub-fields spread only when a device token is issued (src/gateway/server/ws-connection/message-handler.ts:1231-1243).

The outer Type.Optional wrapper on HelloOkSchema.auth at src/gateway/protocol/schema/frames.ts:92-115 wasn't removed.

From Greptile's review of #67810:

The outer Type.Optional wrapper around the auth object in HelloOkSchema was not removed, so schema-driven codegen will still produce an optional type despite the field now being unconditionally present.

Fix direction

Drop the outer Type.Optional(...). Inner deviceToken remains Type.Optional(NonEmptyString) — it is the actually-conditional sub-field.

Impact

  • No runtime change for well-formed payloads (handler already sets auth).
  • Malformed payloads without auth now fail validation earlier (intended tightening).

Happy to submit a PR.

extent analysis

TL;DR

Remove the outer Type.Optional wrapper from the HelloOkSchema.auth definition to align with the unconditional population of the auth field.

Guidance

  • Review the HelloOkSchema.auth definition at src/gateway/protocol/schema/frames.ts:92-115 and remove the outer Type.Optional wrapper.
  • Verify that the schema-driven codegen produces the expected type for the auth field after making this change.
  • Test the updated schema with well-formed and malformed payloads to ensure the intended validation behavior.
  • Consider submitting a PR with the proposed fix, as mentioned in the issue.

Example

No code snippet is provided, as the issue is focused on schema definition changes rather than code modifications.

Notes

The fix direction is clear, but it's essential to test the updated schema thoroughly to ensure no unintended consequences on the validation of auth fields in HelloOk messages.

Recommendation

Apply the workaround by removing the outer Type.Optional wrapper, as it is a targeted fix that addresses the specific issue with the HelloOkSchema.auth definition.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - ✅(Solved) Fix [Bug]: stale Type.Optional wrapper on HelloOkSchema.auth after #67810 [3 pull requests, 1 participants]