Before submitting
Area
apps/server
Environment
- T3 Code 0.0.42 (linux-x64 runtime at
~/.t3/runtime/versions/0.0.42)
- Arch Linux (kernel 7.2.3-arch1-3)
- Provider:
claudeAgent instance with binaryPath pointing at a wrapper that runs the Claude CLI through OpenRouter (ANTHROPIC_BASE_URL=https://openrouter.ai/api), custom model z-ai/glm-5.3-flash
- OpenRouter workspace guardrails block Anthropic models (only the GLM model is allowed)
Steps to reproduce
- Use a
claudeAgent provider whose backend refuses claude-haiku-4-5 (e.g. OpenRouter with workspace guardrails that exclude Anthropic models), with a working custom model configured for threads.
- Leave
textGenerationModelSelection unset (default settings).
- Press Commit on any repo with staged changes.
I captured the exact spawn t3 issues (via a logging wrapper around the configured binary):
claude-ori -p --output-format json \
--json-schema {"type":"object","properties":{"subject":{"type":"string"},"body":{"type":"string"},"branch":{"type":"string"}},...} \
--model claude-haiku-4-5 \
--settings {"disableAllHooks":true} --tools '' --disable-slash-commands \
--strict-mcp-config --permission-mode dontAsk
→ exit 1. stdout contains the real failure:
{"api_error_status":400, "is_error":true, "result":"API Error: 400 0 endpoints out of 4 requested are available matching your guardrail restrictions and data policy. … Model blocked by guardrail: 4 endpoints excluded", ...}
stderr contains only an informational line from our credential wrapper ("Using the OpenRouter credential from the global credential ~/.ori/credentials.json.").
Expected behavior
Commit-message generation should use a model that is actually configured/available on the provider instance — e.g. the instance's defaultModelSelection / custom model — instead of a hardcoded fallback slug that the backend may refuse.
Actual behavior
Every one-shot text-generation operation fails: the Commit button shows
Text generation failed in generateCommitMessage: Claude CLI command failed: Using the OpenRouter credential from the global credential ~/.ori/credentials.json.
i.e. the stderr of the spawn (the wrapper's informational notice) is shown as the entire error, while the real API error sits in stdout and is discarded. Thread-title generation fails the same way (I observed ~36 failing title spawns over several hours, 0 successes) and generateBranchName / generatePrContent share the same path.
Root cause in the 0.0.42 bundle: with settings.textGenerationModelSelection unset, resolveTextGenerationProvider() → fallbackTextGenerationProvider() selects DEFAULT_TEXT_GENERATION_MODEL_BY_PROVIDER[claudeAgent] = "claude-haiku-4-5", ignoring the instance's configured default/custom model. A secondary problem is that runClaudeJson reports stderr when non-empty on non-zero exit, so any wrapper's stderr chatter masks the actual API error from stdout.
Workaround
Setting textGenerationModelSelection explicitly in ~/.t3/userdata/settings.json fixes it immediately (picked up live, no restart needed):
"textGenerationModelSelection": { "instanceId": "claudeAgent", "model": "z-ai/glm-5.3-flash" }
Suggested fixes
- When
textGenerationModelSelection is unset, fall back to the enabled provider instance's configured default model (e.g. defaultModelSelection/custom model) rather than a hardcoded slug; at minimum, skip fallback slugs that don't resolve in the instance's model catalog.
- When the spawned CLI exits non-zero, include the stdout API error (or at least
api_error_status/result from the JSON) in the surfaced error instead of preferring stderr, which may only contain wrapper notices.
Impact
Major degradation or frequent failure
Before submitting
Area
apps/server
Environment
~/.t3/runtime/versions/0.0.42)claudeAgentinstance withbinaryPathpointing at a wrapper that runs the Claude CLI through OpenRouter (ANTHROPIC_BASE_URL=https://openrouter.ai/api), custom modelz-ai/glm-5.3-flashSteps to reproduce
claudeAgentprovider whose backend refusesclaude-haiku-4-5(e.g. OpenRouter with workspace guardrails that exclude Anthropic models), with a working custom model configured for threads.textGenerationModelSelectionunset (default settings).I captured the exact spawn t3 issues (via a logging wrapper around the configured binary):
→ exit 1. stdout contains the real failure:
{"api_error_status":400, "is_error":true, "result":"API Error: 400 0 endpoints out of 4 requested are available matching your guardrail restrictions and data policy. … Model blocked by guardrail: 4 endpoints excluded", ...}stderr contains only an informational line from our credential wrapper ("Using the OpenRouter credential from the global credential ~/.ori/credentials.json.").
Expected behavior
Commit-message generation should use a model that is actually configured/available on the provider instance — e.g. the instance's
defaultModelSelection/ custom model — instead of a hardcoded fallback slug that the backend may refuse.Actual behavior
Every one-shot text-generation operation fails: the Commit button shows
i.e. the stderr of the spawn (the wrapper's informational notice) is shown as the entire error, while the real API error sits in stdout and is discarded. Thread-title generation fails the same way (I observed ~36 failing title spawns over several hours, 0 successes) and
generateBranchName/generatePrContentshare the same path.Root cause in the 0.0.42 bundle: with
settings.textGenerationModelSelectionunset,resolveTextGenerationProvider()→fallbackTextGenerationProvider()selectsDEFAULT_TEXT_GENERATION_MODEL_BY_PROVIDER[claudeAgent] = "claude-haiku-4-5", ignoring the instance's configured default/custom model. A secondary problem is thatrunClaudeJsonreportsstderrwhen non-empty on non-zero exit, so any wrapper's stderr chatter masks the actual API error from stdout.Workaround
Setting
textGenerationModelSelectionexplicitly in~/.t3/userdata/settings.jsonfixes it immediately (picked up live, no restart needed):Suggested fixes
textGenerationModelSelectionis unset, fall back to the enabled provider instance's configured default model (e.g.defaultModelSelection/custom model) rather than a hardcoded slug; at minimum, skip fallback slugs that don't resolve in the instance's model catalog.api_error_status/resultfrom the JSON) in the surfaced error instead of preferring stderr, which may only contain wrapper notices.Impact
Major degradation or frequent failure