GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(bin): openchamber-start.sh ignores unaccounted CLI arguments before reading state and exec · Issue #10547 · developing-today/code

fix(bin): openchamber-start.sh ignores unaccounted CLI arguments before reading state and exec #10547

New issue
Copy link
New issue
Copy link
Closed
#10572
Closed
fix(bin): openchamber-start.sh ignores unaccounted CLI arguments before reading state and exec#10547
#10572
Copy link
Labels
status:done

Description

@dezren39
dezren39
opened on Nov 15, 2026
Issue body actions

Evidence

On origin/main (87e0133554, 2026-11-15), bin/openchamber-start.sh declares/uses only a single positional argument (the OpenChamber serve script path, passed by the home-manager unit shim):

  • serve="$1" (line 23)
  • empty check: if [ -z "$serve" ]; then ... exit 1; fi (lines 24-27)
  • it then reads the standing OpenCode server state/password from ~/.local/state/opencode/service-prod.json, exports credentials, and exec "$serve" (lines 29-41)

There is no $#/extra-argument validation, so any additional positional arguments after the required serve script are silently ignored before sensitive startup work.

Repro (safe, no service started)

Using a throwaway executable that exits immediately as the serve script argument:

tmp=$(mktemp /home/user/.local/share/opencode/tmp/opencode/oc-serve.XXXXXX.sh)
printf '#!/bin/sh\nexit 0\n' > "$tmp" && chmod +x "$tmp"
bash bin/openchamber-start.sh "$tmp" extra-bogus-arg; echo "rc=$?"
rm -f "$tmp"

Observed on this host (with ~/.local/state/opencode/service-prod.json readable): exit code 0 and the dummy serve script was exec'd, proving extra-bogus-arg was ignored and the script proceeded through state/password handling and exec.

Why it matters

bin/openchamber-start.sh is an operator/startup wrapper that reads a local password/state file and exports OPENCODE_PASSWORD before attaching/starting OpenChamber. Ignoring unaccounted CLI arguments violates the operator-script argument contract (#3352): a mis-invocation (extra/typoed argument, wrong argument order, or stale caller assumptions) is silently accepted instead of failing fast, which can lead to starting the service under unintended assumptions.

Acceptance criteria

  • bin/openchamber-start.sh rejects any unaccounted CLI arguments (including extra positional arguments after the required serve-script argument) before reading state, exporting credentials, or exec'ing the serve script.
  • Rejection prints a clear usage/error to stderr and exits non-zero (usage-error exit code consistent with repo operator-script conventions).
  • Existing valid invocation with exactly the expected serve-script argument preserves current behavior.
  • Add/update a regression test (or test harness coverage, as appropriate for this wrapper) covering: missing argument, valid single argument path, and extra/unaccounted argument rejection.

Suggested fix shape

Validate the full command line up front (e.g. require exactly 1 argument, or explicit --/option parsing if expanded later) and emit usage: openchamber-start.sh <serve-script> on violation; keep the current state-file/password checks and exec behavior unchanged for valid input.

Activity

  1. developing-today commented on Nov 15, 2026

    @developing-today
    developing-todayBot
    on Nov 15, 2026 – with developing.today
    Contributor
    More actions

    CODE-3826

  2. developing-today
    added
    status:in-review
    on Nov 16, 2026
  3. dezren39
    added a commit that references this issue on Nov 16, 2026

    fix(bin): reject unaccounted CLI args in openchamber-start.sh (#10547) (

    cc1e95f
  4. dezren39
    closed this as completedin #10572on Nov 16, 2026
  5. developing-today
    added
    status:done
    and removed
    status:in-review
    on Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    status:done

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.