Skip to content

feat(ai): add Standard Compute memory provider preset - #502

Merged
EyJunge1 merged 2 commits into
tickernelz:mainfrom
henrikdukefoss:add-standard-compute-provider
Nov 9, 2026
Merged

EyJunge1 merged 2 commits into
tickernelz:mainfrom
henrikdukefoss:add-standard-compute-provider

Conversation

@henrikdukefoss

Copy link
Copy Markdown
Contributor

Summary

Add an optional Standard Compute memory provider preset using the existing OpenAI Chat Completions transport, following the merged CloudGPU preset in #470 (and Runcrate in #457 before it). Standard Compute is an OpenAI-compatible gateway whose routed StandardCompute model id sends each request to the cheapest capable model.

  • memoryProvider: "standardcompute": endpoint default https://api.stdcmpt.com/v1, model default StandardCompute, STANDARDCOMPUTE_API_KEY fallback, explicit env:// key configuration, and a distinct standardcompute session tag.
  • Factory, configuration validation, readiness detection, example/template, and all README languages updated.
  • Tests mirror the CloudGPU ones: authentication, request serialization (tool_choice: "required"), tool response extraction, overrides, environment-key resolution, and rejection of remote-provider changes from project configuration.
  • No defaults change for existing users. Users opt in with their own key (created at https://standardcompute.com/dashboard; docs at https://docs.standardcompute.com); the docs name the destination for conversation data (https://api.stdcmpt.com).

Files changed

  • src/services/ai/providers/standardcompute.ts (new): StandardComputeProvider extends OpenAIChatCompletionProvider, overriding endpoint, default model and session tag
  • src/services/ai/ai-provider-factory.ts, src/services/ai/provider-config.ts, src/services/ai/session/session-types.ts, src/types/index.ts: wiring and types
  • src/config.ts: provider union, STANDARDCOMPUTE_API_KEY fallback, readiness check, config template
  • opencode-mem.example.jsonc, README.md, .github/i18n/README.{ar,de,nl,tr,zh}.md: docs
  • tests/standardcompute-provider.test.ts (new), tests/ai-provider-config.test.ts, tests/config-resolution.test.ts: tests mirroring the CloudGPU ones

Test plan

  • Exercised the change locally: not done. The tests mirror the CloudGPU tests from feat(ai): add CloudGPU memory provider preset #470 but were not run locally; relying on CI. The default model id StandardCompute was confirmed against the public catalogue at GET https://api.stdcmpt.com/v1/models.
  • Known limitations: same as other OpenAI-compatible presets; "forceToolChoice": false is documented for models that reject forced tool calls.

Checklist

  • Branch is based on main (do not open PRs from commits already on main)
  • bun test passes (not run locally; relying on CI)
  • bun run typecheck passes (not run locally; relying on CI)
  • bun run check passes (not run locally; relying on CI)
  • Docs / README updated when behavior or contribution process changes

Disclosure: I work on Standard Compute; this PR was prepared with AI assistance.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 9, 2026 03:20

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The key-only Standard Compute configuration leaves runtime provider fields undefined, causing auto-capture, profile learning, and dreaming to skip the provider.

1 open issue
What changed in this PR

Adds an opt-in Standard Compute memory provider using the existing OpenAI Chat Completions transport, following the CloudGPU and Runcrate presets without changing existing defaults.

Changes:

  • Adds provider defaults, factory registration, session tagging, and configuration support.
  • Adds tests for authentication, request serialization, response extraction, and configuration handling.
  • Documents setup, data transmission, and tool-choice troubleshooting across all README languages.
File Description
tests/​standardcompute-provider.test.ts Tests provider behavior and factory registration.
tests/​config-resolution.test.ts Tests environment-key fallback and project configuration restrictions.
tests/​ai-provider-config.test.ts Tests minimal configuration and API-key requirements.
src/​types/​index.ts Extends the provider type union.
src/​services/​ai/​session/​session-types.ts Adds the Standard Compute session provider type.
src/​services/​ai/​providers/​standardcompute.ts Implements endpoint, model, and session-tag defaults.
src/​services/​ai/​provider-config.ts Recognizes Standard Compute as a preset provider.
src/​services/​ai/​ai-provider-factory.ts Registers and lists the new provider.
src/​config.ts Adds configuration types, key fallback, readiness handling, and template guidance.
README.md Documents setup, data destination, and troubleshooting.
opencode-mem.example.jsonc Adds commented configuration examples.
.github/​i18n/​README.zh.md Adds Chinese provider documentation.
.github/​i18n/​README.tr.md Adds Turkish provider documentation.
.github/​i18n/​README.nl.md Adds Dutch provider documentation.
.github/​i18n/​README.de.md Adds German provider documentation.
.github/​i18n/​README.ar.md Adds Arabic provider documentation.

Review effort: Balanced

Comment thread src/config.ts Outdated
config.memoryProvider === "runcrate" ||
config.memoryProvider === "cloudgpu"
config.memoryProvider === "cloudgpu" ||
config.memoryProvider === "standardcompute"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in d3b2413: preset endpoint/model defaults are now resolved into runtime CONFIG for all key-only presets (including standardcompute), so auto-capture / dreaming / profile learning see memoryModel + memoryApiUrl. Shared defaults live in memory-provider-presets.ts.

@henrikdukefoss

Copy link
Copy Markdown
Contributor Author

On the Copilot finding: it's real, but it isn't specific to this preset. Every key-only preset follows the same path, including cloudgpu (#470), runcrate, cheaper-inference, atlas-cloud and api-route. buildConfig leaves memoryModel / memoryApiUrl undefined, and these guards then skip the external channel:

  • auto-capture.ts:715
  • user-memory-learning.ts:818
  • dreaming-service.ts:163,221
  • api-handlers.ts:1721
  • user-profile-manager.ts:1601

This PR keeps the existing preset behavior rather than changing it for one provider. The existing config-resolution tests also assert that memoryModel / memoryApiUrl stay undefined for presets.

Happy to do either, whichever you prefer:

  1. A separate follow-up PR that resolves preset defaults (endpoint and model) into CONFIG for all presets, with tests that exercise a key-only config through auto-capture.
  2. Until then, setting memoryModel and memoryApiUrl explicitly in this preset's README example, so key-only users aren't caught by it.

Key-only preset configs were marked ready but left memoryModel/memoryApiUrl
undefined, so auto-capture, dreaming, and profile learning skipped the
external channel. Materialize shared preset defaults during config build.
@EyJunge1

EyJunge1 commented Nov 9, 2026

Copy link
Copy Markdown
Collaborator

Pushed a follow-up fix for the Copilot finding: key-only presets now materialize their default memoryModel / memoryApiUrl into runtime CONFIG, so external auto-capture / dreaming / profile learning actually run. Applies to all presets, not only Standard Compute.

@EyJunge1
EyJunge1 merged commit e856a02 into tickernelz:main Nov 9, 2026
9 checks passed
@EyJunge1 EyJunge1 mentioned this pull request Nov 9, 2026
3 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants