feat(ollama-cloud): add :cloud variant parsing, glm-5.1 fallbacks, and GLM Sisyphus overlay#3517
feat(ollama-cloud): add :cloud variant parsing, glm-5.1 fallbacks, and GLM Sisyphus overlay#3517Pivert wants to merge 6 commits intocode-yeongyu:devfrom
Conversation
…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>
|
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: 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. |
There was a problem hiding this comment.
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>`; |
There was a problem hiding this comment.
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>
…, 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>
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)
Summary
:cloud/:thinkingcolon-variant parsing tomodel-string-parser.tssoollama-cloud/kimi-k2.5:cloudresolves correctly instead of failing fuzzy matchingollama-cloudprovider transform that appends:cloudtag for API calls while keeping bare model IDs for matchingglm-5.1withollama-cloudprovider to fallback chains across key agents (sisyphus, oracle, prometheus, metis, momus) and categories (visual-engineering, ultrabrain, unspecified-high)sisyphus/glm.ts) matching the Gemini overlay pattern — covers tool-call contract, brevity enforcement, constraint extraction, and literalism guardProblem
ollama-cloud/kimi-k2.5:cloudandollama-cloud/glm-5.1:cloudmodels produce "configured model is not valid" warnings at runtime because the:cloudOllama tag suffix is not recognized as a variant and prevents fuzzy matching against the model cacheglm-5.1is missing from fallback chains, forcing users to rely on more expensive providers whenollama-cloudis available as a flat-rate optionFix
cloudtoKNOWN_VARIANTSand new colon-variant regex for Ollama:tagsyntax. Known tags (:cloud,:thinking) are stripped and returned as variants; unknown tags are preserved as part of the model ID.ollama-cloud-tag-aliasandollama-thinking-tag-aliaspattern rules somodel:cloudcanonicalizes tomodelfor capability lookup (belt-and-suspenders with the parser change).ollama-cloudprovider handling that appends:cloudto bare model names for API calls, preserving existing:tags.{ providers: ["ollama-cloud"], model: "glm-5.1" }entries to 8 fallback chains.isGlmModel()intocreateSisyphusAgent()to inject GLM overlays.Testing
tsc --noEmit— 0 errorsbun run build— succeedsFixes #3515