Skip to content

Feature request: use opencodeProvider for tag generation, or support streaming for memoryProvider #442

Closed

Description

@lscar

Feature request: use opencodeProvider for tag generation, or support streaming for memoryProvider

Problem

The memory tag migration endpoint (POST /api/migration/tags/run-batch) always uses the manual API configuration when generating tags:

  • dist/services/api-handlers.js → handleRunTagMigrationBatch
  • It calls buildMemoryProviderConfig(CONFIG, ...) and then AIProviderFactory.createProvider(CONFIG.memoryProvider, ...)
  • The validation in dist/services/ai/provider-config.js requires all three of memoryModel / memoryApiUrl / memoryApiKey

So for users who only configured opencodeProvider + opencodeModel (the Recommended setup in opencode-mem.jsonc), clicking migrate fails immediately:

External API not configured for memory provider: missing memoryModel; missing memoryApiUrl; missing memoryApiKey

Auto-capture (auto-capture.js) and user profile learning (user-memory-learning.js) both fall back to opencodeProvider; tag migration is the only path that does not, so the behavior is inconsistent.

When it fails, the UI shows no error at all — the error response is only visible in the browser DevTools network panel, so users cannot tell why the migration failed.

Separately, the manual path with memoryProvider: openai-chat sends non-streaming requests. Some OpenAI-compatible endpoints (e.g. codebuddy) do not support non-streaming calls and return 400 Non-stream chat request is currently not supported, so migration cannot complete even with all three values configured.

Expected behavior

Both paths should work:

  1. Reuse opencodeProvider: make tag migration consistent with auto-capture — prefer opencodeProvider/opencodeModel when configured, and fall back to the manual API configuration otherwise. This needs only one place to configure and no extra API key.
  2. Support streaming: add an optional streaming mode for memoryProvider (or automatically retry with streaming when a non-streaming request fails), so OpenAI-compatible endpoints that only support streaming also work for tag migration.

Environment

  • opencode-mem 2.34.0
  • OpenCode V2
  • Windows 11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions