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 — opencode-acp-adapter: --server value is never validated — a trailing --server silently talks to the default serve, --server= / a flag-like value loop forever on 'Failed to parse URL', and a typo'd flag is silently ignored · Issue #6939 · developing-today/code

opencode-acp-adapter: --server value is never validated — a trailing --server silently talks to the default serve, --server= / a flag-like value loop forever on 'Failed to parse URL', and a typo'd flag is silently ignored #6939

New issue
Copy link
New issue
Copy link
Closed
#8054
Closed
opencode-acp-adapter: --server value is never validated — a trailing --server silently talks to the default serve, --server= / a flag-like value loop forever on 'Failed to parse URL', and a typo'd flag is silently ignored#6939
#8054
Copy link
Labels
app/opencode-acp-adapterbin/opencode-acp-adapter.mjs — ACP-to-HTTP adapter for the standing OpenCode serveeffort/xsTrivial: expected under 30 minutes of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobstatus:donetask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

Description

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

opencode-acp-adapter: --server value is never validated — a trailing --server silently talks to the default serve, --server= / a flag-like value loop forever on "Failed to parse URL", and a typo'd flag is silently ignored

Summary

bin/opencode-acp-adapter.mjs takes its one operator flag, --server, with no validation at all. In parseServerUrl (lines 64–76 at def55caf48):

function parseServerUrl(argv) {
  let server = process.env.OPENCODE_ACP_SERVER || 'http://127.0.0.1:13420';
  for (let i = 0; i < argv.length; i += 1) {
    if (argv[i] === '--server' && argv[i + 1]) {
      server = argv[i + 1];
      i += 1;
    } else if (argv[i].startsWith('--server=')) {
      server = argv[i].slice('--server='.length);
    }
  }
  return server.replace(/\/+$/, '');
}
  • A trailing --server fails the argv[i + 1] truthiness check and is silently dropped — the adapter talks to the default http://127.0.0.1:13420 serve (or the env var) instead of the server the operator meant to name, with no warning anywhere.
  • --server= sets server to the empty string. Every request becomes a relative URL: the event stream (runEventStream, lines 226–257) logs Failed to parse URL from /api/event; reconnecting and retries every 1s forever, and session calls fail the same way — yet ACP initialize still succeeds, so the gateway sees a healthy agent whose every session is broken.
  • A flag-like value (--server --bogus-flag) is consumed verbatim as the URL: Failed to parse URL from --bogus-flag/api/event; reconnecting, same infinite loop.
  • A typo'd flag (--sever http://127.0.0.1:9) matches nothing in the loop and is silently ignored — again the default serve, no signal.

parseServerUrl is not exported and has no unit coverage: bin/opencode-acp-adapter.test.mjs only ever passes a well-formed --server http://127.0.0.1:<port> (line 105).

Evidence (verified this run, laptop, origin/main def55caf484833e062247c46e5b0c4bb719accd3)

Probe ~/git/fleet/probe-acp-server-arg/ — the real module on the laptop primary (md5 bd0bdaccb8c47bd031bb82a6b8149d08), driven over stdio JSON-RPC (initialize + session/new) with OPENCODE_ACP_ADAPTER_DEBUG=1; the startup debug line prints the resolved serverBase:

Invocation Observed
control: --server http://127.0.0.1:9 started; server=http://127.0.0.1:9; event stream fetch failed; reconnecting (connection refused on the named port — the named server is the one being dialled)
--server (trailing) started; server=http://127.0.0.1:13420 — the explicit flag silently dropped, default serve used
--server= started; server= — event stream error: Failed to parse URL from /api/event; reconnecting (1s retry loop, never exits); initialize still returns success
--server --bogus-flag started; server=--bogus-flag — event stream error: Failed to parse URL from --bogus-flag/api/event; reconnecting, same loop
--sever http://127.0.0.1:9 (typo) started; server=http://127.0.0.1:13420 — unknown flag silently ignored, default serve used

Why it matters

This adapter is the bridge between the ACP gateway (acpx/OpenClaw) and the standing OpenCode serve: prompts, sessions, and the server password resolved in serverPassword() all go to whatever serverBase resolves to. Silently falling back to the default serve means a mis-typed launch sends a session's prompts — authenticated with the standing server's credential — to a different server than the operator configured, and the only evidence is a debug line nobody has on by default. The empty/flag-like cases are the opposite failure with the same silence problem: the process never fails fast, initialize succeeds, and the misconfiguration surfaces only as an endless reconnect loop and per-session URL-parse errors that name no flag and no value.

This is the concrete instance for this script of the repo's strict-argv problem class (umbrella design #3352; sibling instances #3469 for the quota exporters, #3415, #3449) — those filings do not touch this file.

Acceptance criteria

  • --server with a missing (trailing), empty (--server= or --server ""), or flag-like (--…) value fails fast at startup: a usage error on stderr naming the flag and the offending value, non-zero exit, before the event stream starts and before any ACP traffic is served.
  • A --server value that is not a parseable http:/https: URL fails the same way at startup — never as a per-request Failed to parse URL reconnect loop.
  • The valid forms keep working unchanged: --server <url>, --server=<url>, trailing slashes stripped, OPENCODE_ACP_SERVER env fallback, and the built-in default when neither is given.
  • Regression tests in bin/opencode-acp-adapter.test.mjs cover: trailing --server, --server=, flag-like --server value, and a non-URL value — each asserting the fast non-zero exit naming --server; the existing well-formed --server control keeps passing and the full suite passes.
  • Unknown-argument handling (e.g. the --sever typo) follows the contract chosen under Design: unknown means stop — one strict argument contract for the repo's operator scripts #3352 — at minimum it must not silently change which server is dialled without a stderr signal.

Related: #3352 (umbrella strict-argv design), #3469 (same failure class in the three quota exporters — different files, different argv code).

Activity

Next
  1. developing-today commented on Nov 7, 2026

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

    CODE-2187

  2. dezren39
    added
    queue/queuedHas a queued queue task
    source/creatorFiled by the new-issue-creator job
    task/small-fixQueue packet kind: bounded fix with reproduction and targeted tests
    status/needs-triageNot yet triaged; needs a first look
    priority/normalOrdinary priority (the default)
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    effort/xsTrivial: expected under 30 minutes of work
    app/opencode-acp-adapterbin/opencode-acp-adapter.mjs — ACP-to-HTTP adapter for the standing OpenCode serve
    on Nov 7, 2026
  3. dezren39 commented on Nov 7, 2026

    @dezren39
    dezren39
    on Nov 7, 2026
    MemberAuthor
    More actions

    🤖 Agent note · filed

    • Agent: new-issue-creator job (lane A, new-issue-creator-code-a)
    • Session / ID: cron new-issue-creator-code-a, run 2026-11-07 12:35 CST
    • Found via: filed this run
    • Task: Validate the --server value in bin/opencode-acp-adapter.mjs parseServerUrl — fail fast at startup on a trailing/empty/flag-like/non-URL value instead of silently dialling the default serve or looping on URL-parse errors.
    • Expectation: effort xs; done when the acceptance criteria on issue opencode-acp-adapter: --server value is never validated — a trailing --server silently talks to the default serve, --server= / a flag-like value loop forever on 'Failed to parse URL', and a typo'd flag is silently ignored #6939 pass, including regression tests in bin/opencode-acp-adapter.test.mjs.
    • Links: probe ~/git/fleet/probe-acp-server-arg (laptop); related issue Design: unknown means stop — one strict argument contract for the repo's operator scripts #3352, issue pm-stack(quota-exporters): opt() in all three exporters takes a flag token as a value — '--out-dir --cdp-port 19222' writes the export into a directory named '--cdp-port', the flag token is consumed twice, and a non-numeric --cdp-port becomes a NaN CDP outage #3469
  4. dezren39 commented on Nov 8, 2026

    @dezren39
    dezren39
    on Nov 8, 2026
    MemberAuthor
    More actions

    🤖 Agent note · picked up

    • Agent: queue worker (repo-worker-code), lane code-r
    • Session / ID: task 11326
    • Found via: queue claim
    • Task: validate the --server value in bin/opencode-acp-adapter.mjs (fail fast on missing/empty/flag-like/non-URL values, reject unknown arguments) with spawn-level regression tests in bin/opencode-acp-adapter.test.mjs for issue opencode-acp-adapter: --server value is never validated — a trailing --server silently talks to the default serve, --server= / a flag-like value loop forever on 'Failed to parse URL', and a typo'd flag is silently ignored #6939
    • Expectation: effort s; done = PR opened with the full adapter suite passing, task 11326 completed
    • Links: branch queue/11326-6939-acp-server-validation (pending)
  5. dezren39
    added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed
    status/needs-triageNot yet triaged; needs a first look
    queue/queuedHas a queued queue task
    on Nov 8, 2026
  6. 15 remaining items

  7. dezren39
    added
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    queue/claimedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    and removed
    queue/claimedQueue worker lifecycle state
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Nov 9, 2026
  8. dezren39 commented on Nov 9, 2026

    @dezren39
    dezren39
    on Nov 9, 2026
    MemberAuthor
    More actions

    🤖 Agent note · picked up — Agent: queue worker (repo-worker-code), lane code-n — Session/ID: task 11326, repo-queue-worker-shift-n 2026-11-09 run. Task 11326 (small_fix) for issue #6939: opencode-acp-adapter validate --server value. Fresh check: issue #6939 OPEN, no held/user/owned/do-not-merge/do-not-auto-edit labels. Execution lane = direct (row 3645), so this lane works it: validate --server in bin/opencode-acp-adapter.mjs per the issue acceptance criteria, with regression tests.

  9. dezren39
    added a commit that references this issue on Nov 9, 2026

    fix(acp-adapter): validate --server at startup (#6939) (#8054)

    b236b1d
  10. dezren39
    closed this as completedin #8054on Nov 9, 2026
  11. developing-today
    added
    status:done
    on Nov 9, 2026
  12. dezren39
    removed
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 9, 2026
  13. dezren39 commented on Nov 9, 2026

    @dezren39
    dezren39
    on Nov 9, 2026
    MemberAuthor
    More actions

    🤖 Agent note · done — Agent: queue worker (repo-worker-code), lane code-n — Session/ID: task 11326, repo-queue-worker-shift-n 2026-11-09 run. Task 11326 (small_fix) for issue #6939 resumed from the prior attempt's pushed work (§10 resume, don't restart): branch queue/11326-6939-acp-server-validate / PR #8054 already carried the --server validation fix. Verified fresh this shift: node --test bin/opencode-acp-adapter.test.mjs — 18/18 pass on the laptop worktree at b1aa662 (8 new #6939 regression tests included); Codex review posted no concrete findings (its summary comment carried no finding threads and a usage-limit notice). Merged PR #8054 (squash) — merge sha b236b1d; issue #6939 CLOSED.

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

    app/opencode-acp-adapterbin/opencode-acp-adapter.mjs — ACP-to-HTTP adapter for the standing OpenCode serveeffort/xsTrivial: expected under 30 minutes of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobstatus:donetask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

    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.