feat(#31): lend harness provider connection to akm via LLM proxy shim#52
Draft
Copilot wants to merge 3 commits into
Draft
feat(#31): lend harness provider connection to akm via LLM proxy shim#52Copilot wants to merge 3 commits into
Copilot wants to merge 3 commits into
Conversation
3 tasks
- OpenCode plugin: add hasAkmLlmConfigured(), installLlmProxyShim(), buildLlmProxyShimContent(); update shell.env to detect missing akm.llm and set AKM_LLM_PROXY_CMD pointing to the written shim - OpenCode plugin: capture session model in experimental.chat.system.transform and pass AKM_LLM_PROXY_MODEL hint to the shim via shell.env - Claude plugin: add has_akm_llm_configured(), install_llm_proxy_shim(); update session_start() to install the shim and export AKM_LLM_PROXY_CMD - Shim supports Anthropic and OpenAI REST APIs; Claude plugin shim prefers the claude CLI when available; credentials stay in env, never written to disk - Add 8 new tests covering both plugins (5 OpenCode, 3 Claude) Agent-Logs-Url: https://github.com/itlackey/akm-plugins/sessions/4fa609f1-291b-4d18-a289-0b15511e910d Co-authored-by: itlackey <6414031+itlackey@users.noreply.github.com>
… for clarity Agent-Logs-Url: https://github.com/itlackey/akm-plugins/sessions/4fa609f1-291b-4d18-a289-0b15511e910d Co-authored-by: itlackey <6414031+itlackey@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Lend the harness's provider connection to akm when no
feat(#31): lend harness provider connection to akm via LLM proxy shim
May 4, 2026
akm.llm is configured
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.
When
akm.llmis not configured,akm indexinference and graph passes silently skip. This PR wires both plugins to detect that state and install a stdio-contract proxy shim so akm can borrow the harness's existing provider connection for those passes.Contract
Shim reads JSON
{"prompt":"...","system":"...","model":"..."}from stdin, writes completion text to stdout, exits 0 on success. Non-zero exit degrades the index pass to no-op (never fatal).OpenCode plugin
hasAkmLlmConfigured(cache?)— callsakm config get llm, treats empty/null/{}as unconfigured. Per-instance cache (closure) avoids repeated CLI calls inshell.envwithout leaking state across test runs.installLlmProxyShim(stateDir)— writes the shim to$AKM_PLUGIN_STATE_DIR(falls back to XDG_STATE_HOME); catches all errors and returnsnull(non-fatal).shell.envnow setsAKM_LLM_PROXY_CMDwhen unconfigured, plusAKM_LLM_PROXY_MODELsourced from the session model captured inexperimental.chat.system.transform.Claude plugin
has_akm_llm_configured()/install_llm_proxy_shim()shell functions added.session_start()calls them whenakm.llmis unset; exportsAKM_LLM_PROXY_CMDfor the hook process lifetime.claude -pfirst (reuses session auth) before falling back to REST API keys.Security
Provider credentials are never written to disk — the shim inherits
ANTHROPIC_API_KEY/OPENAI_API_KEYfrom the harness process environment.Pending
AKM CLI must still land
AKM_LLM_PROXY_CMDsupport inresolveIndexPassLLM()(tracked initlackey/akm). This PR covers the full plugin side so the integration is ready to wire up once the CLI contract ships.