mirror of
https://github.com/mikeyobrien/ralph-orchestrator.git
synced 2026-04-24 22:55:57 +03:00
[PR #109] [MERGED] fix: Honor hat-level backend configuration and args #138
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ralph-orchestrator#138
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/mikeyobrien/ralph-orchestrator/pull/109
Author: @zuozuo
Created: 1/25/2026
Status: ✅ Merged
Merged: 1/27/2026
Merged by: @mikeyobrien
Base:
main← Head:fix/hat-backend-args-ignored📝 Commits (6)
38a1eaadocs: add bug analysis for hat-level backend configuration issue9a07b7bfix: honor hat-level backend configuration and args568e2d4fix(review): address all P0 and P1 issues from super-reviewacf2736fix(critical): 使用 active hat ID 获取 backend 配置bce2112fix(critical): 修复 starting_event 配置被忽略的 bug71382d2fix(review): 修复 P1 问题 - backend_name 生命周期和注释📊 Changes
8 files changed (+1657 additions, -11 deletions)
View changed files
➕
.reviews/pr109_super_review/meta.json(+1 -0)➕
.reviews/pr109_super_review/review_codex.md(+715 -0)➕
.reviews/pr109_super_review/summary.md(+298 -0)➕
BUG_ANALYSIS.md(+276 -0)➕
BUG_EXAMPLE.md(+272 -0)📝
crates/ralph-adapters/src/pty_executor.rs(+11 -0)📝
crates/ralph-cli/src/loop_runner.rs(+78 -10)📝
crates/ralph-core/src/event_loop/mod.rs(+6 -1)📄 Description
Problem
Hat-level backend configuration (including and ) was being completely ignored. All hats were using the global regardless of their custom backend settings.
Example of broken behavior
Configuration:
Expected: Each hat uses its configured backend with specified args
Actual: All hats used
claudewith no args (global config)Root Cause
loop_runner.rscreated a single global backend at startup fromcliconfig and reused it for all hats, never checkinghat.backend.Code location:
crates/ralph-cli/src/loop_runner.rs:161Solution
Before executing each hat, check if it has custom backend config using
event_loop.get_hat_backend(). If present, create a backend usingCliBackend::from_hat_backend(). Otherwise, fall back to global backend.Changes:
Impact
This fix enables:
--model gpt-5.1-codex-max)--dangerously-bypass-approvals-and-sandbox)Testing
Tested with the configuration example above:
claudewith no argstest_writercallscodex --model gpt-5.1-codex-max --yolobackend_implementercallscodex --dangerously-bypass-approvals-and-sandboxSee attached
BUG_EXAMPLE.mdfor detailed examples andBUG_ANALYSIS.mdfor technical analysis.Backwards Compatibility
✅ Fully backwards compatible
cli.backend🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.