Skip to content

feat(ollama-cloud): add :cloud variant parsing, glm-5.1 fallbacks, and GLM Sisyphus overlay#3517

Draft
Pivert wants to merge 6 commits intocode-yeongyu:devfrom
Pivert:fix/ollama-cloud-provider
Draft

feat(ollama-cloud): add :cloud variant parsing, glm-5.1 fallbacks, and GLM Sisyphus overlay#3517
Pivert wants to merge 6 commits intocode-yeongyu:devfrom
Pivert:fix/ollama-cloud-provider

Conversation

@Pivert
Copy link
Copy Markdown

@Pivert Pivert commented Apr 18, 2026

⚠️ DRAFT PR — PAUSED FOR EXTENSIVE TESTING

This PR was generated via AI/Vibe coding (Sisyphus orchestrator + GLM-5.1 model). It requires thorough manual testing before merge. Do not review or merge until the author confirms testing is complete.

Summary

  • Add Ollama-style :cloud/:thinking colon-variant parsing to model-string-parser.ts so ollama-cloud/kimi-k2.5:cloud resolves correctly instead of failing fuzzy matching
  • Add ollama-cloud provider transform that appends :cloud tag for API calls while keeping bare model IDs for matching
  • Add glm-5.1 with ollama-cloud provider to fallback chains across key agents (sisyphus, oracle, prometheus, metis, momus) and categories (visual-engineering, ultrabrain, unspecified-high)
  • Add thin GLM-specific Sisyphus prompt overlay (sisyphus/glm.ts) matching the Gemini overlay pattern — covers tool-call contract, brevity enforcement, constraint extraction, and literalism guard

Problem

  • ollama-cloud/kimi-k2.5:cloud and ollama-cloud/glm-5.1:cloud models produce "configured model is not valid" warnings at runtime because the :cloud Ollama tag suffix is not recognized as a variant and prevents fuzzy matching against the model cache
  • glm-5.1 is missing from fallback chains, forcing users to rely on more expensive providers when ollama-cloud is available as a flat-rate option

Fix

  1. model-string-parser.ts: Add cloud to KNOWN_VARIANTS and new colon-variant regex for Ollama :tag syntax. Known tags (:cloud, :thinking) are stripped and returned as variants; unknown tags are preserved as part of the model ID.
  2. model-capability-aliases.ts: Add ollama-cloud-tag-alias and ollama-thinking-tag-alias pattern rules so model:cloud canonicalizes to model for capability lookup (belt-and-suspenders with the parser change).
  3. provider-model-id-transform.ts (shared + CLI): Add ollama-cloud provider handling that appends :cloud to bare model names for API calls, preserving existing : tags.
  4. model-requirements.ts: Add { providers: ["ollama-cloud"], model: "glm-5.1" } entries to 8 fallback chains.
  5. sisyphus/glm.ts (new): Four overlay sections — tool contract, brevity, constraint extraction, literalism guard.
  6. sisyphus.ts: Wire isGlmModel() into createSisyphusAgent() to inject GLM overlays.

Testing

  • tsc --noEmit — 0 errors
  • bun run build — succeeds
  • 171 model-related tests pass (8 test files)
  • 278 agent tests pass (19 test files)
  • 20 new tests added: 16 for model-string-parser, 4 for capability aliases
  • 4 new ollama-cloud transform tests in CLI
  • ⚠️ Manual end-to-end testing still in progress — DO NOT MERGE

Fixes #3515

François Delpierre and others added 4 commits April 18, 2026 22:23
…ansform

Handle Ollama-style :cloud/:thinking tag suffixes in model string
parsing so ollama-cloud/kimi-k2.5:cloud resolves correctly instead
of failing fuzzy matching against the model cache.

- Add 'cloud' to KNOWN_VARIANTS in model-string-parser.ts
- Add colon-variant regex for model:tag format (Ollama tag syntax)
- Add pattern alias rules to canonicalize :cloud/:thinking suffixes
- Add ollama-cloud provider transform that appends :cloud for API calls
- Mirror ollama-cloud transform in CLI-local provider-model-id-transform

Closes code-yeongyu#3515

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Signed-off-by: François Delpierre <git@pivert.org>
…prompt overlay

GLM-5.1 (ZhipuAI/Tsinghua) is now available as a fallback model
via the ollama-cloud provider across key agents (sisyphus, oracle,
prometheus, metis, momus) and categories (visual-engineering,
ultrabrain, unspecified-high).

Add a thin GLM overlay in sisyphus/glm.ts that counters known
GLM tendencies: pseudo-tool-call narration, verbosity, literalism,
and missed implicit constraints. Follows the Gemini overlay pattern
rather than GPT-5.4's full custom prompt.

Closes code-yeongyu#3515

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Signed-off-by: François Delpierre <git@pivert.org>
… tests

Update model-requirements.test.ts for new glm-5.1/ollama-cloud
fallback entries (sisyphus chain: 7→8, visual-engineering: 5→6).
Add 4 ollama-cloud transform tests covering :cloud appension,
preservation of existing tags, and glm-5.1 specifically.

Closes code-yeongyu#3515

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Signed-off-by: François Delpierre <git@pivert.org>
…lization tests

Add 16 tests for parseVariantFromModelID and parseModelString
covering :cloud/:thinking colon-variant parsing, unknown tag
preservation, and standard variant formats. Add 4 tests for
resolveModelIDAlias covering :cloud/:thinking tag canonicalization
with and without provider prefixes.

Closes code-yeongyu#3515

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Signed-off-by: François Delpierre <git@pivert.org>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 18, 2026

Thank you for your contribution! Before we can merge this PR, we need you to sign our Contributor License Agreement (CLA).

To sign the CLA, please comment on this PR with:

I have read the CLA Document and I hereby sign the CLA

This is a one-time requirement. Once signed, all your future contributions will be automatically accepted.


I have read the CLA Document and I hereby sign the CLA


François Delpierre seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@Pivert Pivert marked this pull request as draft April 18, 2026 22:40
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 11 files

Confidence score: 5/5

  • This PR looks low risk overall; the only reported issue is low severity (3/10) and appears limited in scope.
  • In src/agents/sisyphus/glm.ts, a mismatched closing tag in the emitted section could cause malformed output formatting, but it is unlikely to introduce broad functional regression.
  • Pay close attention to src/agents/sisyphus/glm.ts - ensure the opened tag and closing tag match to avoid malformed rendered content.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src/agents/sisyphus/glm.ts">

<violation number="1" location="src/agents/sisyphus/glm.ts:66">
P3: Close the same tag you open here; the section currently emits a mismatched closing tag.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

4. **Stop conditions** → stop when the task is done, not when you feel like adding more

If the user says "only change X", do not change Y. If the user says "fix the bug", do not refactor. If scope is ambiguous, ask ONE clarifying question — do not guess and over-deliver.
</GLM_CONSTRAINT_ENFORCEMENT>`;
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot Apr 18, 2026

Choose a reason for hiding this comment

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

P3: Close the same tag you open here; the section currently emits a mismatched closing tag.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/agents/sisyphus/glm.ts, line 66:

<comment>Close the same tag you open here; the section currently emits a mismatched closing tag.</comment>

<file context>
@@ -0,0 +1,80 @@
+4. **Stop conditions** → stop when the task is done, not when you feel like adding more
+
+If the user says "only change X", do not change Y. If the user says "fix the bug", do not refactor. If scope is ambiguous, ask ONE clarifying question — do not guess and over-deliver.
+</GLM_CONSTRAINT_ENFORCEMENT>`;
+}
+
</file context>
Fix with Cubic

François Delpierre and others added 2 commits April 18, 2026 22:46
…, and prompt overlay guidance

Add high-signal entries for model variant parsing, provider transforms,
glm.ts prompt overlay pattern, and dual sync requirement between
shared and CLI provider-model-id-transform files.

Closes code-yeongyu#3515

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Signed-off-by: François Delpierre <git@pivert.org>
gutierrezx7 added a commit to gutierrezx7/oh-my-openagent that referenced this pull request Apr 26, 2026
Add comprehensive support for DeepSeek-V4 models to enable users to leverage
DeepSeek's advanced agent capabilities within the OMO orchestration framework.

## Changes

### Model Detection (src/agents/types.ts)
- Add isDeepSeekV4Model() - detect any V4 variant
- Add isDeepSeekV4ProModel() - detect Pro with thinking support
- Add isDeepSeekV4FlashModel() - detect Flash for fast inference
- Add isDeepSeekR1Model() - detect R1 reasoning model (future use)

### Native Prompt (src/agents/sisyphus/deepseek-v4.ts)
- Create optimized prompt (~330 LOC vs ~540 default)
- Compact structure to avoid "lost in the middle" issues
- XML-tagged sections for clear parsing
- Phases: Intent → Tools → Implementation → Recovery → Completion

### Routing (src/agents/sisyphus.ts)
- Add V4-specific routing branch before default prompt
- V4-Pro: thinking enabled with 32k budget
- V4-Flash: optimized for speed without thinking

### Fallback Chains (src/shared/model-requirements.ts)
- Add deepseek-v4-pro to Sisyphus fallback chain
- Add deepseek-v4-pro to Oracle fallback chain

### Tests (src/agents/types.test.ts)
- Add 42 comprehensive test cases
- Cover provider-prefixed and providerless models
- Test variant separation (Pro vs Flash)
- Test negative cases (V3, R1, other models)

## Why Native Prompt?

Unlike Gemini which requires corrective overlays, DeepSeek-V4:
- Follows system prompts correctly (unlike R1)
- Has native tool calling with strict mode support
- Doesn't hallucinate tool calls
- Benefits from compact, well-structured prompts

## Usage

Configure in oh-my-opencode.jsonc:
{
  "agents": {
    "sisyphus": {
      "model": "llmgateway/deepseek-v4-pro"
    }
  }
}

## Testing

- All 42 new tests pass
- Build succeeds (1295 modules)
- TypeScript type checking passes
- Schema JSON regenerated

Refs: code-yeongyu#2072
Related: code-yeongyu#3517 (follows same GLM overlay pattern)
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.

[Feature]: Add ollama-cloud: configured model ollama-cloud/kimi-k2.5:cloud is not valid

1 participant