Skip to content

feat(ai): add Morse memory provider preset - #534

Merged
EyJunge1 merged 1 commit into
tickernelz:v3from
askmorse:feat/morse-provider
Dec 4, 2026
Merged

EyJunge1 merged 1 commit into
tickernelz:v3from
askmorse:feat/morse-provider

Conversation

@askmorse

@askmorse askmorse commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds an optional Morse inference API memory provider preset.

Maintainer rewrite (v3): The original PR targeted main with a per-file src/services/ai/providers/morse.ts provider (2.x pattern). On v3, OpenAI-compatible gateways are registry entries in src/ai/memory-provider-presets.ts plus the shared PresetOpenAIChatProvider — no vendor class, factory case, or session-type union change. This branch was rewritten accordingly and retargeted to v3.

  • memoryProvider: "morse": endpoint default https://inference.trymorse.ai/v1, model default deepseek/deepseek-v4.1-flash, MORSE_API_KEY fallback
  • Docs: README + i18n, opencode-mem.example.jsonc, config template comments
  • Tests: key-only + env resolution cases (mirrors other presets)

Test plan

  • bun test tests/ai/ai-provider-config.test.ts tests/shared/config-resolution.test.ts tests/ai/preset-openai-chat-provider.test.ts
  • Pre-commit hook (tsc + eslint + prettier) on commit

Checklist

  • Branch is based on v3
  • Docs / README updated when behavior changes

@lindixu6-hash lindixu6-hash left a comment

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.

Thanks for the contribution and for disclosing the team affiliation. The preset follows the established pattern, but before this can be considered for merge, could you please: (1) run the full test suite plus typecheck and lint locally (bun test / bun run typecheck / bun run lint) and post the results, and (2) verify the preset against the live endpoint if at all possible, since the current tests are mocks only. Provider inclusion itself is a maintainer decision, which we'll pick up once the verification side is covered.

@askmorse

askmorse commented Dec 3, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the review. Live check first, since that was the open question:

I sent the request the plugin builds (one tool, tool_choice: "required", temperature: 0.3, non-streaming) to https://inference.trymorse.ai/v1/chat/completions with a real key, using a memory-extraction tool schema:

model HTTP finish_reason tool call arguments parse latency
deepseek/deepseek-v4.1-flash (the preset default) 200 tool_calls save_memories yes, 2 memories 1.3 s
z-ai/glm-5.3-uncensored 200 tool_calls save_memories yes, 2 memories 2.3 s

Next I'm running bun test, bun run typecheck and bun run lint on this branch (and on main, to separate any existing failures), plus the same live call through the PR's own MorseProvider with the defaults, and will post the output here.

@askmorse

askmorse commented Dec 3, 2026

Copy link
Copy Markdown
Contributor Author

Results on 57c9f2e (bun 1.4.5; bun install --frozen-lockfile, web install, bun run build, then the checks), with main at d37f14f run the same way:

this branch (57c9f2e) main (d37f14f)
bun test 1349 pass / 4 skip / 1 fail 1335 pass / 4 skip / 1 fail
bun run typecheck pass pass
bun run lint pass, 0 warnings pass
bun run check pass pass
PR's test files (morse-provider, ai-provider-config, config-resolution) 92 pass / 0 fail n/a

The one failure is the same test on both: OpenCode plugin loader bundle boundary > does not pull local embedding transformer internals into the plugin-loader bundle (the literal node_modules/@huggingface/transformers path now appears in src/services/optional-embedding-stack.ts); it also fails in your Platform Package Smoke run 46611766484 on main, so it isn't from this PR.

Live check through the PR's own code: buildMemoryProviderConfig({ memoryProvider: "morse", memoryApiKey }) with no URL or model set, then new MorseProvider(...) and executeToolCall(...) with the save_memory schema and the capture prompts from auto-capture.ts (so the provider itself sent tool_choice: "required", temperature: 0.3, non-streaming):

defaults memoryModel: "z-ai/glm-5.3-uncensored"
endpoint / model https://inference.trymorse.ai/v1/chat/completions, deepseek/deepseek-v4.1-flash same endpoint, z-ai/glm-5.3-uncensored
result 200, tool_calls, save_memory, arguments parsed and passed the provider's validator, success on the first iteration same
latency 1.9 s 2.4 s

getProviderName() returned morse in both runs.

Register Morse as a v3 OpenAI-chat preset (endpoint/model/env key) instead of a per-vendor provider class.
@EyJunge1
EyJunge1 force-pushed the feat/morse-provider branch from 57c9f2e to bb981e0 Compare December 4, 2026 08:48
@EyJunge1
EyJunge1 changed the base branch from main to v3 December 4, 2026 08:48
@EyJunge1

EyJunge1 commented Dec 4, 2026

Copy link
Copy Markdown
Collaborator

Rewrote this for the current v3 memory-provider model and retargeted the base to v3.

On v3, OpenAI-compatible presets are a registry entry in src/ai/memory-provider-presets.ts (shared PresetOpenAIChatProvider) — no per-vendor provider file / factory switch. Same endpoint/model/MORSE_API_KEY defaults as your original PR.

@EyJunge1
EyJunge1 merged commit 8d2bb80 into tickernelz:v3 Dec 4, 2026
1 check passed
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