Skip to content

fix(ollama): drop /api/chat suffix option and surface stream errors - #81

Merged
haywolf merged 3 commits into
masterfrom
fix/72-followup-ollama-chat-endpoint
Nov 4, 2026
Merged

haywolf merged 3 commits into
masterfrom
fix/72-followup-ollama-chat-endpoint

Conversation

@haywolf

@haywolf haywolf commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #78 review (#72).

  • Dropdown keeps only /chat: /api/chat on the default base http://localhost:11434/api requested /api/api/chat (404).
  • New idempotent migration rewrites saved Ollama /api/chat suffixes to base ending in /api + /chat, so no saved config resolves to /api/api/chat (endpoint URL unchanged for working configs).
  • OllamaClient throws on data.error and when the response/stream contains no message, for both streaming and non-streaming paths.
  • Tests: Provider dropdown, migration replay over saved-config cases, client error paths.

Verified locally: test:unit 982 passed, test:renderer 283 passed, typecheck, build.

- Provider dropdown offers only /chat; /api/chat built /api/api/chat on the default /api base
- Migration moves saved /api/chat suffixes to base .../api + /chat (same URL, never /api/api/chat)
- OllamaClient throws on data.error and when no message is returned (stream and non-stream)
- Tests for dropdown, migration and client error paths

Follow-up to #78 review.
@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

AI Code Review Summary

PR: #81 (fix(ollama): drop /api/chat suffix option and surface stream errors)
Preferred language: English

Overall Assessment

No blocking issue was detected in the reviewed diff; keep focused regression testing before merge.

Major Findings by Severity

No major issues identified from the reviewed diff.

Actionable Suggestions

  • Address the highest severity findings first and add targeted tests for changed logic.

Potential Risks

  • Potential hidden risks remain in edge cases not covered by the current diff context.

Test Suggestions

  • Add happy-path + boundary + failure-path tests for touched modules.

File-Level Coverage Notes

  • src/core/application/services/tests/OllamaProtocol.test.ts: File was in scope but not fully reviewed before budget limits. (coverage_incomplete)
  • src/core/infrastructure/adapters/llm/OllamaClient.ts: File was in scope but not fully reviewed before budget limits. (coverage_incomplete)
  • src/core/infrastructure/adapters/llm/tests/OllamaClient.test.ts: File was in scope but not fully reviewed before budget limits. (coverage_incomplete)
  • src/core/infrastructure/db/tests/OllamaChatSuffixMigration.test.ts: File was in scope but not fully reviewed before budget limits. (coverage_incomplete)
  • src/renderer/components/Provider.tsx: File was in scope but not fully reviewed before budget limits. (coverage_incomplete)
  • src/renderer/components/tests/Provider.test.tsx: File was in scope but not fully reviewed before budget limits. (coverage_incomplete)

Inline Downgraded Items (processed but not inline)

  • None

Coverage Status

  • Target files: 6
  • Covered files: 0
  • Uncovered files: 6
  • No-patch/binary covered as file-level: 0
  • Findings with unknown confidence (N/A): 0

Uncovered list:

  • src/core/application/services/tests/OllamaProtocol.test.ts: coverage_incomplete
  • src/core/infrastructure/adapters/llm/OllamaClient.ts: coverage_incomplete
  • src/core/infrastructure/adapters/llm/tests/OllamaClient.test.ts: coverage_incomplete
  • src/core/infrastructure/db/tests/OllamaChatSuffixMigration.test.ts: coverage_incomplete
  • src/renderer/components/Provider.tsx: coverage_incomplete
  • src/renderer/components/tests/Provider.test.tsx: coverage_incomplete

No-patch covered list:

  • None

Runtime/Budget

  • Rounds used: 1/4
  • Planned batches: 1
  • Executed batches: 1
  • Sub-agent runs: 1
  • Planner calls: 2
  • Reviewer calls: 2
  • Model calls: 4/64
  • Structured-output summary-only degradation: YES

Reasons:

  • planner_structured_output_failed_round_1: Structured output failed after repair: You have no permission to access this resource (api_key_source: payg) (request_id: eb5d4183d7c24a9581f71f7e3438bdde)
  • reviewer_structured_output_failed_round_1_general: Structured output failed after repair: You have no permission to access this resource (api_key_source: payg) (request_id: 9686acd35bab47f6bfc66239f88d6e9f)

@haywolf
haywolf merged commit f1a4d78 into master Nov 4, 2026
3 checks passed
@haywolf
haywolf deleted the fix/72-followup-ollama-chat-endpoint branch November 4, 2026 04:53
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.

1 participant