Skip to content

fix: improve error propagation in SessionHttpApi to prevent opaque UnknownError during local model calls#5551

Open
linzhanyu wants to merge 2 commits into
code-yeongyu:devfrom
linzhanyu:fix/sisyphus-generic-model-fallback
Open

fix: improve error propagation in SessionHttpApi to prevent opaque UnknownError during local model calls#5551
linzhanyu wants to merge 2 commits into
code-yeongyu:devfrom
linzhanyu:fix/sisyphus-generic-model-fallback

Conversation

@linzhanyu

@linzhanyu linzhanyu commented Jun 24, 2026

Copy link
Copy Markdown

Summary

This PR fixes a critical crash occurring when the system attempts to initialize Sisyphus agents for unrecognized or local model providers (e.g., llama.cpp models like Gemma4 or Qwen series).
Previously, if a model name did not match established vendor patterns (like GPT or Claude), it would fall through an incomplete fallback chain in the agent factory. This resulted in an UnknownError during session initialization and message creation, effectively blocking use of high-performance local LLMs within the orchestration loop.
This change introduces a standardized generic configuration builder to ensure any unrecognized model receives a valid, functional orchestrator profile by default.

Changes

  • Agent Configuration: Added buildGenericSisyphusAgentConfig in sisyphus-agent-config.ts to provide a reliable fallback profile (including proper prompts, permissions, and descriptions) for unknown model types.
  • Factory Refactoring: Updated sisyphus-agent-factory.ts to replace the fragile vendor-specific fallback chain with the new generic configuration builder, ensuring all models are covered regardless of their identity.

QA & Evidence

  • What was tested: Initialization of Sisyphus agents using local model identifiers (e.g., super.llama.swap/gemma4-26b and qwen3.6).
    Observed result: Agents now initialize successfully without throwing UnknownError. The fallback configuration is correctly applied, allowing the /ulw-loop to proceed normally.
    Artifact: Refer to local terminal logs / .omo/evidence/ if available
    Why sufficient: Confirms that the "unrecognized model" code path no longer leads to an unhandled exception during agent factory execution.

Risks & Residuals

  • Generic Config Quality: There is a slight risk that highly specialized models might benefit from vendor-specific tuning; however, this generic profile provides a stable baseline that prevents system crashes (Mitigated).
  • Regression on Known Models: The refactor was tested to ensure GPT and Claude patterns remain intact (Mitigated).

Screenshots

image
Before After
UnknownError during agent init Successful Agent Initialization

Automated Checks

bun run typecheck
bun test

Related Issues


Summary by cubic

Fixes an opaque UnknownError when initializing Sisyphus agents for unrecognized or local models. Local llama.cpp models like Gemma4 and Qwen now start and run normally in the orchestration loop.

  • Bug Fixes
    • Added buildGenericSisyphusAgentConfig to create a safe default profile for unknown models.
    • Replaced vendor-specific fallback in sisyphus-agent-factory with the generic builder, avoiding GPT-only settings on non-GPT models and preventing crashes during initialization.

Written for commit 2afc1c2. Summary will update on new commits.

Review in cubic

Add generic fallback config builder for high-performance instruction-following
models (Gemma4, Qwen3.6, etc.) that don't match specific vendor patterns.

This ensures ANY unrecognized model name gets a valid orchestrator config
with proper prompt, permissions, and description instead of crashing with
UnknownError during session message creation.
… factory

Replace the old isGptModel/isClaudeModel fallback chain with a single
buildGenericSisyphusAgentConfig call for all unrecognized models.

Before: unknown models would fall through to isGptModel check, which could
        produce incorrect config (e.g., reasoningEffort for non-GPT models)
After:  all unknown models get a clean generic config with proper prompt

Fixes UnknownError crashes when using local llama.cpp models like
super.llama.swap/gemma4-26b, super.llama.swap/qwen3.6-27b, etc.
@github-actions

github-actions Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA. Thank you! ✅
Posted by the CLA Assistant Lite bot.

@github-actions github-actions Bot added the opencode OpenCode edition: packages/omo-opencode label Jun 24, 2026
@linzhanyu

Copy link
Copy Markdown
Author

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

github-actions Bot added a commit that referenced this pull request Jun 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

opencode OpenCode edition: packages/omo-opencode

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant