mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-08 13:12:08 +00:00
refactor(codex-runtime): tidy reapply-migration control flow
Self-review follow-up (hermes-pr-review Phase 2, non-blocking clarity findings). - Collapse the reapplying_enable predicate to a single chained comparison (new_value == current == "codex_app_server") instead of a two-clause AND that re-tested new_value == current. - Dedent the msg_lines list literals (drop trailing single-element commas). No behavior change: reapply still falls through to the idempotent migrate() while skipping set_runtime/persist (prompt cache preserved), and the auto-disable early-return is unchanged. 31/31 tests green.
This commit is contained in:
parent
35eb93c8df
commit
7322da487f
1 changed files with 3 additions and 7 deletions
|
|
@ -153,9 +153,7 @@ def apply(
|
|||
# config.yaml without ever running the slash command. The migration is
|
||||
# idempotent by design (it replaces its own managed block in place), so
|
||||
# re-running is cheap and safe.
|
||||
reapplying_enable = (
|
||||
new_value == current and new_value == "codex_app_server"
|
||||
)
|
||||
reapplying_enable = new_value == current == "codex_app_server"
|
||||
if new_value == current and not reapplying_enable:
|
||||
return CodexRuntimeStatus(
|
||||
success=True,
|
||||
|
|
@ -199,12 +197,10 @@ def apply(
|
|||
|
||||
if reapplying_enable:
|
||||
msg_lines = [
|
||||
f"openai_runtime already set to {current} — re-applying migration",
|
||||
f"openai_runtime already set to {current} — re-applying migration"
|
||||
]
|
||||
else:
|
||||
msg_lines = [
|
||||
f"openai_runtime: {current} → {new_value}",
|
||||
]
|
||||
msg_lines = [f"openai_runtime: {current} → {new_value}"]
|
||||
if new_value == "codex_app_server":
|
||||
ok, ver = _check_binary_cached()
|
||||
if ok:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue