Skip to content

test(opencode): Ollama OpenAI-compat baseURL /v1 residual - #12

Merged
TimothyVang merged 1 commit into
mainfrom
agent/m15-ollama-compat
Jul 9, 2026
Merged

test(opencode): Ollama OpenAI-compat baseURL /v1 residual#12
TimothyVang merged 1 commit into
mainfrom
agent/m15-ollama-compat

Conversation

@TimothyVang

Copy link
Copy Markdown
Owner

Summary

  • Confirms bash scripts/check-httpapi-error-contracts.sh passes (26 tests).
  • Caseforge agent 404 page not found is not an opencode provider/OpenAI path bug: @ai-sdk/openai-compatible POSTs ${baseURL}/chat/completions; Ollama only serves that under /v1. Bare VERDICT_LLM_BASEURL=http://host:11434 hits /chat/completions → plain page-not-found. Normalization belongs in caseforge (engine lane).
  • Residual: offline provider tests lock that this runtime preserves baseURL as configured (does not auto-append /v1); optional smoke scripts/check-ollama-openai-compat.sh; short note in VERDICT-FORK.md.

Evidence

bash scripts/check-httpapi-error-contracts.sh  # 26 pass
bun test test/provider/provider.test.ts -t "Ollama-style"  # 2 pass
VERDICT_LLM_BASEURL=http://10.126.60.100:11434/v1 bash scripts/check-ollama-openai-compat.sh
# PASS: Ollama OpenAI-compat reachable (v1 OpenAI JSON error vs bare page-not-found)

Test plan

  • Error-contract script
  • New Ollama-style provider tests
  • Optional live Ollama smoke against Spark
  • No TUI rebrand / no engine behavior change

Document that caseforge agent 404 (plain "404 page not found") is from a
bare Ollama root missing /v1, not a provider path bug in this runtime.
Preserve baseURL as configured; optional smoke for live /v1/chat/completions.
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@TimothyVang
TimothyVang merged commit eb416b0 into main Jul 9, 2026
6 of 8 checks passed
@TimothyVang
TimothyVang deleted the agent/m15-ollama-compat branch July 9, 2026 17:29

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 88cc2e505e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +21 to +23
origin="${raw%/}"
origin="${origin%/v1}"
v1_chat="${origin}/v1/chat/completions"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Reject bare VERDICT_LLM_BASEURL in smoke test

When VERDICT_LLM_BASEURL is set to the misconfigured bare Ollama root (http://host:11434), this script strips/normalizes it into origin and then probes ${origin}/v1/chat/completions, so it reports PASS even though the runtime would still POST to ${VERDICT_LLM_BASEURL}/chat/completions and hit the documented 404 page not found. Since this smoke check is meant to catch that exact missing-/v1 configuration, validate the supplied base URL (or probe the raw configured request path) before constructing the corrected /v1 URL.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant