Skip to content

fix(mode-switch): use portable case folding for Bash 3.2 compatibility - #5880

Closed
vaibhavsrv wants to merge 1 commit into
Osmantic:public-betafrom
vaibhavsrv:fix/mode-switch-bash32-compat
Closed

vaibhavsrv wants to merge 1 commit into
Osmantic:public-betafrom
vaibhavsrv:fix/mode-switch-bash32-compat

Conversation

@vaibhavsrv

Copy link
Copy Markdown
Contributor

Why this matters

In ods/scripts/mode-switch.sh, switch_mode() checked LLM_BACKEND and ODS_MODEL_SWITCHBOARD casing using Bash 4 case-modification parameter expansion: ${configured_backend,,} and ${switchboard_mode,,}. On systems running Bash 3.2 (notably default macOS shells using /bin/bash), running mode-switch.sh immediately fails with /bin/bash: ${configured_backend,,}: bad substitution, preventing operators from inspecting mode status or switching inference targets.

This patch adopts portable tr '[:upper:]' '[:lower:]' case normalization, ensuring mode transitions and external routing validations execute reliably across both modern Bash 4+ and macOS default Bash 3.2 environments.

Validation

  • Repro baseline: Executed mode-switch.sh cloud under /bin/bash with uppercase/mixed-case environment settings; confirmed failure with /bin/bash: ${configured_backend,,}: bad substitution.
  • Post-fix: Verified ods/tests/test_mode_switch_bash32.py passes with exit code 0 under /bin/bash; switches mode cleanly and correctly enforces external LLM routing guardrails.
  • CLI mode switch suites: 1 passed. New-test syntax and diff checks pass; new regressions wired into Linux CI.

Overlap check

Risk / AI disclosure

AI-assisted investigation, implementation and CLI regressions. This strengthens shell compatibility for mode switching across POSIX and Bash 3.2 platforms, not daemon runtime execution. Independent human review and platform/runtime qualification remain gates. No running configuration, deployment or upstream merge changed.

Follow-up integration evidence

Composed with #5871 at 81b881c without conflicts. Production and test diffs passed together; mode-switch contracts remain intact.
Backlog composition was local-only (production/test diffs, excluding workflow/Makefile wiring); it is not an upstream merge or independent human approval. Declared live-review gates remain open.

@Lightheartdevs

Copy link
Copy Markdown
Collaborator

Thanks for this contribution. public-beta was promoted into main on 2026-09-24 and no longer receives changes, so we're closing pull requests that target it. This isn't a judgment on the change itself. If it's still needed, please rebase onto main and open a focused PR. See #7253 for details and the contribution policy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants