1---2name: gateway3description: Skill for the Gateway area of Wiki. 1131 symbols across 303 files.4---56# Gateway781131 symbols | 303 files | Cohesion: 56%910## When to Use1112- Working with code in `AI/`13- Understanding how waitForNodeStatus, runNodeHost, coerceNodeInvokePayload work14- Modifying gateway-related functionality1516## Key Files1718| File | Symbols |19|------|---------|20| `AI/3-Application/Openclaw-source/apps/android/app/src/main/java/ai/openclaw/app/gateway/GatewaySession.kt` | refreshNodeCanvasCapability, handleConnectSuccess, handleMessage, handleResponse, handleEvent (+32) |21| `AI/3-Application/Openclaw-source/src/gateway/session-utils.ts` | truncateTitle, deriveSessionTitle, resolvePositiveNumber, resolveNonNegativeNumber, resolveEstimatedSessionCostUsd (+28) |22| `AI/3-Application/Openclaw-source/src/gateway/session-utils.fs.ts` | normalizeRole, extractPreviewText, isToolCall, extractMediaSummary, buildPreviewItems (+20) |23| `AI/3-Application/Openclaw-source/src/gateway/server-chat.ts` | resolveMergedAssistantText, add, peek, remove, createSessionMessageSubscriberRegistry (+19) |24| `AI/3-Application/Openclaw-source/src/gateway/call.ts` | ensureGatewaySupportsRequiredMethods, executeGatewayRequestWithScopes, resolveGatewayCallTimeout, callGatewayWithScopes, callGatewayScoped (+17) |25| `AI/3-Application/Openclaw-source/src/gateway/test-helpers.server.ts` | rpcReq, occupyPort, onceMessage, getFreePort, startGatewayServerWithRetries (+17) |26| `AI/3-Application/Openclaw-source/apps/android/app/src/main/java/ai/openclaw/app/gateway/GatewayDiscovery.kt` | startUnicastDiscovery, publish, refreshUnicast, keyName, recordsByName (+16) |27| `AI/3-Application/Openclaw-source/src/gateway/hooks.ts` | extractHookToken, normalizeHookHeaders, normalizeWakePayload, resolveHookChannel, resolveHookDeliver (+15) |28| `AI/3-Application/Openclaw-source/src/gateway/net.ts` | resolveGatewayListenHosts, normalizeIp, parseIpLiteral, parseRealIp, resolveForwardedClientIp (+15) |29| `AI/3-Application/Openclaw-source/src/gateway/client.ts` | GatewayClient, start, queueConnect, scheduleReconnect, request (+13) |3031## Entry Points3233Start here when exploring this area:3435- **`waitForNodeStatus`** (Function) — `AI/3-Application/Openclaw-source/test/helpers/gateway-e2e-harness.ts:338`36- **`runNodeHost`** (Function) — `AI/3-Application/Openclaw-source/src/node-host/runner.ts:143`37- **`coerceNodeInvokePayload`** (Function) — `AI/3-Application/Openclaw-source/src/node-host/invoke.ts:564`38- **`connectGatewayClient`** (Function) — `AI/3-Application/Openclaw-source/src/gateway/test-helpers.e2e.ts:27`39- **`clampProbeTimeoutMs`** (Function) — `AI/3-Application/Openclaw-source/src/gateway/probe.ts:34`4041## Key Symbols4243| Symbol | Type | File | Line |44|--------|------|------|------|45| `GatewayClient` | Class | `AI/3-Application/Openclaw-source/src/gateway/client.ts` | 130 |46| `DeviceIdentityStore` | Class | `AI/3-Application/Openclaw-source/apps/android/app/src/main/java/ai/openclaw/app/gateway/DeviceIdentityStore.kt` | 17 |47| `GatewayLockError` | Class | `AI/3-Application/Openclaw-source/src/infra/gateway-lock.ts` | 37 |48| `GatewaySession` | Class | `AI/3-Application/Openclaw-source/apps/android/app/src/main/java/ai/openclaw/app/gateway/GatewaySession.kt` | 81 |49| `DeviceAuthStore` | Class | `AI/3-Application/Openclaw-source/apps/android/app/src/main/java/ai/openclaw/app/gateway/DeviceAuthStore.kt` | 10 |50| `GatewaySecretRefUnavailableError` | Class | `AI/3-Application/Openclaw-source/src/gateway/credentials.ts` | 35 |51| `InvokeResult` | Class | `AI/3-Application/Openclaw-source/apps/android/app/src/main/java/ai/openclaw/app/gateway/GatewaySession.kt` | 104 |52| `ErrorShape` | Class | `AI/3-Application/Openclaw-source/apps/android/app/src/main/java/ai/openclaw/app/gateway/GatewaySession.kt` | 112 |53| `waitForNodeStatus` | Function | `AI/3-Application/Openclaw-source/test/helpers/gateway-e2e-harness.ts` | 338 |54| `runNodeHost` | Function | `AI/3-Application/Openclaw-source/src/node-host/runner.ts` | 143 |55| `coerceNodeInvokePayload` | Function | `AI/3-Application/Openclaw-source/src/node-host/invoke.ts` | 564 |56| `connectGatewayClient` | Function | `AI/3-Application/Openclaw-source/src/gateway/test-helpers.e2e.ts` | 27 |57| `clampProbeTimeoutMs` | Function | `AI/3-Application/Openclaw-source/src/gateway/probe.ts` | 34 |58| `probeGateway` | Function | `AI/3-Application/Openclaw-source/src/gateway/probe.ts` | 38 |59| `createOperatorApprovalsGatewayClient` | Function | `AI/3-Application/Openclaw-source/src/gateway/operator-approvals-client.ts` | 6 |60| `createHooksRequestHandler` | Function | `AI/3-Application/Openclaw-source/src/gateway/server-http.ts` | 370 |61| `buildHookReplayCacheKey` | Function | `AI/3-Application/Openclaw-source/src/gateway/server-http.ts` | 417 |62| `createHooksHandler` | Function | `AI/3-Application/Openclaw-source/src/gateway/server-http.test-harness.ts` | 183 |63| `extractHookToken` | Function | `AI/3-Application/Openclaw-source/src/gateway/hooks.ts` | 136 |64| `normalizeHookHeaders` | Function | `AI/3-Application/Openclaw-source/src/gateway/hooks.ts` | 175 |6566## Execution Flows6768| Flow | Type | Steps |69|------|------|-------|70| `StartGatewayServer → ApplyAgentDefaults` | cross_community | 6 |71| `StartGatewayServer → IsRecord` | cross_community | 6 |72| `StartGatewayServer → NormalizeConfigIssuePath` | cross_community | 6 |73| `StartGatewayServer → Trim` | cross_community | 5 |74| `StartGatewayServer → SanitizeTerminalText` | cross_community | 5 |75| `StartGatewayServer → ToLowerCase` | cross_community | 5 |76| `StartGatewayServer → IsValidProfileName` | cross_community | 5 |77| `AttachGatewayWsMessageHandler → ToLowerCase` | cross_community | 5 |78| `AttachGatewayWsMessageHandler → IsIpv4Address` | cross_community | 5 |79| `AttachGatewayWsMessageHandler → IsIpv6Address` | cross_community | 5 |8081## Connected Areas8283| Area | Connections |84|------|-------------|85| Scripts | 188 calls |86| Infra | 90 calls |87| Agents | 53 calls |88| Auto-reply | 46 calls |89| Plugins | 41 calls |90| Commands | 33 calls |91| Ink | 32 calls |92| Sessions | 26 calls |9394## How to Explore95961. `gitnexus_context({name: "waitForNodeStatus"})` — see callers and callees972. `gitnexus_query({query: "gateway"})` — find related execution flows983. Read key files listed above for implementation details