[PR #2411] [MERGED] Restore Cohere compatibility defaults #5592

Closed
opened 2026-10-22 04:17:39 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/2411
Author: @Promansis
Created: 6/6/2026
Status: ✅ Merged
Merged: 6/6/2026
Merged by: @Promansis

Base: refactor ← Head: fix/issue-2387-cohere-defaults-upstream


📝 Commits (1)

  • a946ef9 Restore Cohere compatibility defaults

📊 Changes

3 files changed (+133 additions, -14 deletions)

View changed files

📝 src-tauri/crates/llm/src/lib.rs (+39 -8)
📝 src-tauri/src/commands/storage/llm.rs (+92 -4)
📝 src/engine/contracts/constants/providers.ts (+2 -2)

📄 Description

Linked issue

Closes #2387

Why this change

  • Cohere connections created from the provider picker were seeded with a host that does not directly match the authenticated OpenAI-compatible API surface Marinara uses.
  • Storage model lookup also rewrote Cohere compatibility bases to native /v1/models, and generation rewrote compatibility bases to native v2 chat paths.
  • That meant new or reset Cohere connections could mix OpenAI-compatible request shapes with native Cohere paths.

What changed

  • Restored Cohere's provider default to https://api.cohere.com/compatibility/v1.
  • Kept Cohere's provider modelsEndpoint as /models.
  • Made model lookup build https://api.cohere.com/compatibility/v1/models for Cohere compatibility bases.
  • Routed Cohere compatibility-base streaming and non-streaming generation through the OpenAI-compatible /chat/completions path while preserving native v2 behavior for explicit v2 bases.
  • Added focused Rust coverage for the model-list URL/auth contract and Cohere generation endpoint routing.

Refactor impact

Primary owner:

React-free engine provider contracts, Rust storage LLM model lookup, and Rust LLM provider transport.

Impact areas reviewed:

  • CreateConnectionModal seeds new connections from PROVIDERS[provider].defaultBaseUrl.
  • ConnectionEditor displays and reseeds provider defaults from the same provider catalog.
  • connection_models now checks Cohere compatibility model listing through /compatibility/v1/models with Bearer auth.
  • Cohere generation keeps streaming and non-streaming compatibility calls on /compatibility/v1/chat/completions.

Boundary notes:

  • Engine provider constant changed in src/engine/contracts/constants/providers.ts.
  • Rust storage model lookup changed in src-tauri/src/commands/storage/llm.rs.
  • Rust LLM transport changed in src-tauri/crates/llm/src/lib.rs.
  • No React feature, shared API, HTTP dispatch, or command-registration changes.

Pressure points touched:

  • LLM model listing.
  • LLM provider transport.

Validation

  • Matching validation command passes locally (for example pnpm typecheck, pnpm build, pnpm check:architecture, pnpm check:docs, or full pnpm check when warranted)
  • Full pnpm check passes before PR push/handoff
  • Human/manual validation completed by contributor or reviewer

Manual verification notes

  • pnpm typecheck
  • pnpm check
  • cargo test --manifest-path src-tauri/Cargo.toml cohere_ -- --nocapture
  • cargo test --manifest-path src-tauri/crates/llm/Cargo.toml cohere_ -- --nocapture
  • Mocked model-list smoke verified GET /compatibility/v1/models plus Authorization: Bearer sk-test-key through connection_models.
  • Live Cohere provider transport was not exercised.

Feature Discoverability

Check exactly one:

  • Updated src/features/shell/discovery/ because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool.
  • N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find.

Reason:

  • Provider compatibility fix only; no new user-discoverable feature.

Docs and release impact

  • No docs changes needed
  • Updated README.md
  • Updated CONTRIBUTING.md
  • Updated docs/developer/
  • Updated repo skills or AGENTS.md
  • Confirmed this PR does not restore old staging/package-workspace/release claims

UI evidence

  • Not applicable; no visible UI layout or interaction change.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/2411 **Author:** [@Promansis](https://github.com/Promansis) **Created:** 6/6/2026 **Status:** ✅ Merged **Merged:** 6/6/2026 **Merged by:** [@Promansis](https://github.com/Promansis) **Base:** `refactor` ← **Head:** `fix/issue-2387-cohere-defaults-upstream` --- ### 📝 Commits (1) - [`a946ef9`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a946ef9d13a9600dff48d7c46ef4ba72944dd7c4) Restore Cohere compatibility defaults ### 📊 Changes **3 files changed** (+133 additions, -14 deletions) <details> <summary>View changed files</summary> 📝 `src-tauri/crates/llm/src/lib.rs` (+39 -8) 📝 `src-tauri/src/commands/storage/llm.rs` (+92 -4) 📝 `src/engine/contracts/constants/providers.ts` (+2 -2) </details> ### 📄 Description ## Linked issue Closes #2387 ## Why this change - Cohere connections created from the provider picker were seeded with a host that does not directly match the authenticated OpenAI-compatible API surface Marinara uses. - Storage model lookup also rewrote Cohere compatibility bases to native `/v1/models`, and generation rewrote compatibility bases to native v2 chat paths. - That meant new or reset Cohere connections could mix OpenAI-compatible request shapes with native Cohere paths. ## What changed - Restored Cohere's provider default to `https://api.cohere.com/compatibility/v1`. - Kept Cohere's provider `modelsEndpoint` as `/models`. - Made model lookup build `https://api.cohere.com/compatibility/v1/models` for Cohere compatibility bases. - Routed Cohere compatibility-base streaming and non-streaming generation through the OpenAI-compatible `/chat/completions` path while preserving native v2 behavior for explicit v2 bases. - Added focused Rust coverage for the model-list URL/auth contract and Cohere generation endpoint routing. ## Refactor impact Primary owner: React-free engine provider contracts, Rust storage LLM model lookup, and Rust LLM provider transport. Impact areas reviewed: - `CreateConnectionModal` seeds new connections from `PROVIDERS[provider].defaultBaseUrl`. - `ConnectionEditor` displays and reseeds provider defaults from the same provider catalog. - `connection_models` now checks Cohere compatibility model listing through `/compatibility/v1/models` with Bearer auth. - Cohere generation keeps streaming and non-streaming compatibility calls on `/compatibility/v1/chat/completions`. Boundary notes: - Engine provider constant changed in `src/engine/contracts/constants/providers.ts`. - Rust storage model lookup changed in `src-tauri/src/commands/storage/llm.rs`. - Rust LLM transport changed in `src-tauri/crates/llm/src/lib.rs`. - No React feature, shared API, HTTP dispatch, or command-registration changes. Pressure points touched: - LLM model listing. - LLM provider transport. ## Validation - [x] Matching validation command passes locally (for example `pnpm typecheck`, `pnpm build`, `pnpm check:architecture`, `pnpm check:docs`, or full `pnpm check` when warranted) - [x] Full `pnpm check` passes before PR push/handoff - [ ] Human/manual validation completed by contributor or reviewer ### Manual verification notes - `pnpm typecheck` - `pnpm check` - `cargo test --manifest-path src-tauri/Cargo.toml cohere_ -- --nocapture` - `cargo test --manifest-path src-tauri/crates/llm/Cargo.toml cohere_ -- --nocapture` - Mocked model-list smoke verified `GET /compatibility/v1/models` plus `Authorization: Bearer sk-test-key` through `connection_models`. - Live Cohere provider transport was not exercised. ## Feature Discoverability Check exactly one: - [ ] Updated `src/features/shell/discovery/` because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool. - [x] N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find. Reason: - Provider compatibility fix only; no new user-discoverable feature. ## Docs and release impact - [x] No docs changes needed - [ ] Updated `README.md` - [ ] Updated `CONTRIBUTING.md` - [ ] Updated `docs/developer/` - [ ] Updated repo skills or `AGENTS.md` - [ ] Confirmed this PR does not restore old staging/package-workspace/release claims ## UI evidence - Not applicable; no visible UI layout or interaction change. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:17:39 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#5592
No description provided.