Repository navigation
fix(ollama): preserve hosted subdomain model context - #144891
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 11, 2026, 7:51 AM ET / 11:51 UTC. ClawSweeper reviewWhat this changesThe PR preserves advertised model context for hosted Ollama subdomains, shares the existing hostname classifier, extends preparation coverage, and removes obsolete tooling references. Merge readiness✅ Ready for maintainer review This remains a useful, focused fix: current main and v2026.9.4 still apply the local context cap to hosted subdomains. No introduced correctness or security defect was found, and the protected maintainer label also prevents cleanup closure. Priority: P2 Review scores
Verification
How this fits togetherThe Ollama plugin turns server-reported model capabilities into configuration used by onboarding and agent execution. Its context preparation distinguishes hosted models from local models that need a conservative memory allocation. flowchart TD
A[Configured Ollama endpoint] --> C[Hosted hostname classification]
B[Reported model context] --> D[Model context preparation]
C --> D
D --> E[Hosted context preserved]
D --> F[Local context capped]
E --> G[Onboarding and agent configuration]
F --> G
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -7, Tests 0, Other -2. Total -9 across 8 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep one plugin-owned hosted-hostname classifier for context preparation, preserve local caps and explicit configuration, and retain the separate transport-policy boundary. Do we have a high-confidence way to reproduce the issue? Yes: current-main source shows that a bare model on an Ollama subdomain receives the local cap, and the PR records matching before/after onboarding results. This read-only review did not execute the application or tests. Is this the best way to solve the issue? Yes: reusing discovery's existing hostname classification repairs the context decision at its shared owner without adding configuration or changing transport authorization. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 7764767a88b3. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Landed after clean exact-head review and green CI. Proof: Real onboarding queried a controlled Ollama HTTP fixture and saved the resulting configuration. Independent acceptance inspected the complete CLI, HTTP, and saved-config records.
The canonical HTTPS-origin transport policy remains unchanged. The stale setup worker/test and two deleted list-test routes are removed; the live auth route and assertion baseline remain. Validation passed: 400 Ollama checks, 480 routing checks, and readiness for all 17 real-Gateway config fixtures. Three corpus fixtures needed forced teardown after the fixed grace period, so graceful shutdown and sustained performance are not claimed. This is controlled HTTP-fixture proof, not live Ollama Cloud inference. |
Preserve the reviewed harness while incorporating the landed benchmark prerequisite. Punchcard-Session: coral-orchard-orchard-d4 * commit '4407ed19ac63b1c1c84a0cfe6eb4bbeca9c2322c': (1196 commits) fix(perf): isolate benchmark subprocess transport (#144159) refactor(auth): await Copilot cache persistence (#144810) refactor(web-fetch): exercise URL normalization through the public tool (#144887) fix(ollama): preserve hosted subdomain model context (#144891) fix(doctor): explain Codex plugin health failures (#144813) fix(channels): honor pinned accounts in Mattermost model menus (#144880) fix(update): failed-update records hide the triggering error behind the excerpt tail (#144729) fix(logging): preserve OpenClaw package references in diagnostics (#144808) fix: retain plugin detail tab selections while inspection loads (#144647) fix: keep discovered models when sign-in tokens renew (#144861) fix(update): preserve local package overrides (#89985) fix(update): resolve compatibility bridges within the runtime graph (#144831) chore(i18n): refresh native locales (#144856) fix: preserve child signal termination during CLI respawn (#144838) fix(text): hide encoded MiniMax tool envelopes (#126307) fix(subagents): deliver child replies that match the empty placeholder (#130647) fix(cli): reject blank message channel selectors (#144802) fix(telegram): preserve mixed text order and pending stop (#144839) fix(memory): restore FTS fallback for same-name view collisions (#144783) chore(release): close out 2026.9.4 on main (#144708) ...
Share hosted Ollama classification between discovery and context preparation so hosted subdomains retain advertised context. Remove stale routes for deleted setup and model-list tests. Validated with real onboarding against hosted/local fixtures, registered provider and routing checks, and the real Gateway config corpus. Co-authored-by: Ayaan Zaidi <[email protected]>
What Problem This Solves
Onboarding a bare model name through a hosted service subdomain could save the local 32,768-token cap even when discovery reported a larger context.
Why This Change Was Made
Discovery and context preparation now share the hosted-hostname classifier. Transport policy keeps its separate HTTPS-origin checks. Obsolete test-routing references are removed.
User Impact
Hosted aliases preserve their advertised context; local models retain their existing cap. No configuration keys or migration change.
Evidence
Real noninteractive onboarding against a controlled endpoint reported 262,144 tokens. Before the fix, the hosted alias saved a 32,768-token cap; afterward it saved no local cap. The local control retained the cap. Focused provider and routing tests passed 400 and 480 cases. All 17 sanitized configs reached Gateway readiness with documented repairs and an exposure override. Live hosted inference and graceful shutdown were not established.
Related: #136257.