docs: address SKALE integration feedback - #45
Open
lloydmak99 wants to merge 1 commit into
Open
Conversation
The SKALE team integrated OpenClaw 2026.7.12 with NEAR AI Cloud and filed
five findings. All five were valid; four were documentation gaps.
Deterministic signature retrieval (chat-verification): the direct endpoint
serves signatures from a per-replica in-memory cache behind an L4 SNI load
balancer with no session affinity, so a lookup can land on a replica that
never saw the completion. dsv4-flash had 5 healthy backends, making the
old "just retry" advice a coin flip. Replaces that note with three
deterministic paths: the durable gateway lookup, a pinned -i{N} replica
for both calls, and a bounded sweep driven by the public /backends/count.
max_output_length and is_ready (model-discovery): the first is an advisory
OpenRouter-compat hint that nothing enforces — the gateway forwards
max_tokens unchanged — and the second is OpenRouter's catalog publication
flag, not an availability signal. Both now documented as such.
prompt_tokens_details (prompt-caching, openai-compatibility): explains why
a cache miss returns null rather than {"cached_tokens": 0} — the engine
emits null and the gateway returns the provider's exact bytes so the
model-TEE signature verifies byte-for-byte — with a client-side snippet.
OpenClaw guide and compatibility matrix: OpenClaw could not consume
supported_features, so it disabled usage-in-streaming, strict mode, and
the developer role by default. All three are supported. Adds the
integration guide and a feature matrix.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The SKALE team integrated OpenClaw 2026.7.12 with NEAR AI Cloud and filed five findings. All five were validated against live endpoints and source on 2026-08-18. Four are documentation gaps and are addressed here; the fifth (
prompt_tokens_details) is explained rather than changed, because it cannot be fixed at the gateway.Deterministic signature retrieval
The biggest one.
GET https://{slug}.completions.near.ai/v1/signature/{chat_id}returns 404 non-deterministically, which broke SKALE's TEE-verification prototype.The cause is by design: the signature is cached in a per-process in-memory
mokacache inside the model TEE that served the completion, andmodel-proxyis an L4 SNI passthrough balancer with least-connections and no session affinity — it cannot route on achat_idit never decrypts.dsv4-flash.completions.near.aihad 5 healthy backends on 2026-08-18, so the old "simply retry until you hit the right one" note was a 1-in-5 coin flip.Replaces that note with three deterministic paths, all verified live:
GET https://cloud-api.near.ai/v1/signature/{chat_id}. cloud-api pins the chat id to the serving backend and persists the signature to thechat_signaturestable at completion time. One call, no retries.https://{slug}-i{N}.completions.near.airoutes to backendN % healthy_count. Send the completion and the lookup to the same hostname.GET https://completions.near.ai/backends/count?domain=…and iterate0..healthy-1.Documents the caveat that the
-i{N}index is positional and rebinds when the healthy backend count changes./backends/listis auth-gated and deliberately not documented.max_output_lengthandis_readyBoth were reported as misleading; both reports were correct.
max_output_lengthis advisory catalog metadata published for OpenRouter-schema compatibility. Nothing enforces it — the gateway forwardsmax_tokensunchanged. A catalog-wide audit found no serving configuration imposes a fixed per-response output cap on any model; every configured limit is a total-sequence bound, a concurrency limit, or a prefill chunk size.is_readyis OpenRouter's catalog publication flag, not an availability signal. Every proxied third-party model reportsfalsewhile being fully serviceable, and the field is omitted entirely on others.prompt_tokens_detailsOn a cache miss, TEE-hosted models return
nullrather than OpenAI's{"cached_tokens": 0}. The inference engine emitsnulland the gateway returns the provider's exact response bytes so the model-TEE signature verifies byte-for-byte; normalizing at the gateway would break chat verification. Documented as a known deviation with a client-side snippet.OpenClaw guide and compatibility matrix
OpenClaw cannot consume
supported_features, so it applies conservative defaults to an unrecognized provider and disables usage-in-streaming, strict mode, and the developer role. All three are supported. Adds the integration guide (following theintegrations/README.mdsection contract) and a feature matrix mapping each OpenAI request feature to NEAR AI Cloud support.Verification
npm run buildpasses.onBrokenLinksis set tothrow, so every internal link resolves; no anchor warnings.🤖 Generated with Claude Code