adapter: tested xAI/Grok x.klickd context bridge#110
Merged
Conversation
Add a hermetic, OpenAI-compatible chat-message bridge and a two-mode (--check dry-run / --live) resume example over the existing xAI/Grok adapter, plus load/bridge/error tests. Document guardrails, trust boundary, and provider-specific limits.
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.
Summary
Implements issue #109 — a compatible xAI/Grok ↔
.klickdcontext bridge with tests, building on the existingexamples/v4/integrations/xai_grok/klickd_xai.pyadapter.klickd_to_messages(payload, user_message)— a pure, network-free function returning the OpenAI-compatible[{system}, {user}]listchat.completionsaccepts.chat()now shares this code path, and the missing-key check runs before theopenaiimport so the error path is robust withoutopenaiinstalled.load_starter_skill("coding.klickd")(publicget_starter_skill_bytesaccessor) and surfaces packverification_gates/human_authority/memory_scopein the system prompt.resume_chat_example.pywith--check(hermetic dry-run: noopenai, no network, no key) and--live(real Grok turn viaXAI_API_KEY,base_url=https://api.x.ai/v1).tests/test_xai_grok_adapter.py— 15 hermetic tests covering load (persona / starter pack / encrypted roundtrip), bridge (message shape, gate surfacing, underscore stripping, injection guard), and error paths (path traversal, non-object JSON, bad JSON, empty prompt, missing API key).docs/integrations/xai_grok.mdgains a check/live example section and a Limitations & guardrails block (compatible-bridge-not-native, no GDPR/EU AI Act claim, no universal-standard wording, optional compressed memory, prompt-injection trust boundary, encrypted files, host-enforced gates, provider-specific limits).The README integration table already links the xAI Grok guide, so no table change was needed.
Guardrails honored: workflow bridge over xAI's OpenAI-compatible API (not native support beyond this adapter); no automatic compliance claim; compressed memory optional; trust boundary, encrypted files, prompt-injection risk, and provider limits documented.
Testing
Closes #109
🤖 Generated by Computer