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 — check-opencode-metered-providers: entry-point check uses resolve() not realpath — invoked via any symlink the PAYG guard silently no-ops with exit 0 · Issue #4694 · developing-today/code

check-opencode-metered-providers: entry-point check uses resolve() not realpath — invoked via any symlink the PAYG guard silently no-ops with exit 0 #4694

New issue
Copy link
New issue
Copy link
Closed
#4697
Closed
check-opencode-metered-providers: entry-point check uses resolve() not realpath — invoked via any symlink the PAYG guard silently no-ops with exit 0#4694
#4697
Copy link
Labels
app/check-opencode-metered-providersbin/check-opencode-metered-providers.mjs metered PAYG provider guardapp/pm-stackpm-stack (Pad/Grist) in developing-today/codeeffort/xsTrivial: expected under 30 minutes of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)queue/queuedHas a queued queue tasksource/creatorFiled by the new-issue-creator jobtask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

Description

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

Summary

bin/check-opencode-metered-providers.mjs — the guard that fails CI/local checks when a metered (PAYG) provider (deepseek, cloudflare-*) is selected without an adjacent // payg-exception: marker — silently no-ops when invoked through any symlink. Its entry-point check at line 359 (origin/main 03b5817dc) is:

if (process.argv[1] && resolve(process.argv[1]) === fileURLToPath(import.meta.url)) {
  await main();
}

path.resolve() only normalizes the invoked path; it does not resolve symlinks, while fileURLToPath(import.meta.url) is the module's real path. Invoked via a symlinked file or through a symlinked directory (e.g. the fleet's own ~/code -> ~/git/code checkout alias that caused #2083), the two never match, main() never runs, and the process exits 0 with no output — a metered selection that should fail the guard reports as passing.

This is the same bug class as #2083 / #2235 / #4325, in a fifth file and in a different syntactic shape (reversed comparison, resolve() instead of pathToFileURL(...).href), so the repo-wide grep in #4325's acceptance criteria — written against the pathToFileURL shape — does not catch it. A grep for fileURLToPath(import.meta.url) entry-point comparisons in bin/ at origin/main shows this is the only remaining instance in that shape (the other hits are dirname(...) path derivations, test helpers, or the already-fixed realpathSync comparison in bin/provider-catalog-sync.mjs:936).

Evidence (laptop probe ~/git/fleet/probe-2026-11-02-laneB-meteredentry/, file extracted verbatim from origin/main 03b5817dc, md5 72912190ea823ae65c7ef6898f9b64fb both sides)

Config under test: { "model": "deepseek/deepseek-chat" } (a metered selection with no payg-exception marker).

  • Direct: node real/check.mjs config.jsonc → stderr Metered-provider config guard failed … metered provider "deepseek" selected by $.model …, exit 1 — the guard ran and failed the config.
  • Via a file symlink: node link.mjs config.jsonc → no output, exit 0 — the guard never ran; the metered selection silently "passes".
  • Via a symlinked directory: node linkdir/check.mjs config.jsonc → no output, exit 0 — same silent no-op.
  • Control, clean config direct (meta/… model): prints Metered-provider config guard passed, exit 0 — the direct path works as designed.

Why it matters

This guard is the automated backstop for the house rule that PAYG providers are a reserve, never a routine route. A check that exits 0 without checking anything is worse than no check: any wrapper, symlink farm, or checkout-alias invocation (the exact layout that already burned the fleet in #2083) turns a failing metered selection into a green pass, and nothing anywhere records that the guard was skipped.

Distinct from #4325 (open): that issue names four files (bin/codedb-bridge.mjs, the supabase/cloudflare exporters, the claimant installer), all in the pathToFileURL(process.argv[1]).href shape. This file is not named there and its reversed resolve(...) === fileURLToPath(...) shape evades that issue's grep-based acceptance criterion; it needs its own fix (or an explicit addition to #4325's scope plus a widened grep).

Acceptance criteria

  • bin/check-opencode-metered-providers.mjs runs main() when invoked via a symlinked file path and via a symlinked directory path (use the fs.realpathSync-on-both-sides comparison proven in bin/proxy-supervise.mjs and applied in fix(bin): run main when provider-catalog-sync and record are invoked via symlink (#2235) #4123, or an equivalent).
  • Importing the module as a library (its test suite does this) still does not run main().
  • A regression test spawns the guard via a symlink against a metered config and asserts exit 1 with the failure message (and via a symlink against a clean config, exit 0 with the pass message).
  • The repo-wide entry-point grep is widened to catch both shapes (pathToFileURL(argv[1]) and resolve(argv[1]) === fileURLToPath(import.meta.url)), and bin+pm-stack: four entry points still use the pre-#2083 raw-path entry-point check — codedb-bridge, supabase/cloudflare exporters and the claimant installer silently no-op via any symlink #4325's acceptance grep is updated or cross-linked so this shape cannot survive that sweep either.

Related: #2083 (original instance + proven fix pattern), #2235 (closed by #4123), #4325 (open — the other four instances, different shape), #2350 (open — meta-exporter instance).

Found by new-issue-creator-code-b (lane B) this run.

Activity

  1. dezren39
    added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    queue/queuedHas a queued queue task
    source/creatorFiled by the new-issue-creator job
    task/triageQueue packet kind: verify, reproduce, and route this item
    status/needs-triageNot yet triaged; needs a first look
    priority/normalOrdinary priority (the default)
    effort/xsTrivial: expected under 30 minutes of work
    app/pm-stackpm-stack (Pad/Grist) in developing-today/code
    app/check-opencode-metered-providersbin/check-opencode-metered-providers.mjs metered PAYG provider guard
    on Nov 3, 2026
  2. dezren39 commented on Nov 3, 2026

    @dezren39
    dezren39
    on Nov 3, 2026
    MemberAuthor
    More actions

    🤖 Agent note · state: filed

    • Agent: new-issue-creator (new-issue-creator-code-b)
    • Session / ID: new-issue-creator-code-b run 2026-11-02 18:50 CST
    • Found via: filed this run
    • Task: Triage the symlinked-invocation silent no-op in the metered-provider guard's entry-point check (bin/check-opencode-metered-providers.mjs:359); fix is the realpathSync-on-both-sides comparison plus a symlink regression test.
    • Expectation: effort/xs; done = guard runs via file-symlink and symlinked-dir invocations, library import still does not run main, regression test covers both, bin+pm-stack: four entry points still use the pre-#2083 raw-path entry-point check — codedb-bridge, supabase/cloudflare exporters and the claimant installer silently no-op via any symlink #4325 grep widened/cross-linked.
    • Links: laptop probe ~/git/fleet/probe-2026-11-02-laneB-meteredentry/ (origin/main 03b5817, md5 72912190ea823ae65c7ef6898f9b64fb); related bin+pm-stack: four entry points still use the pre-#2083 raw-path entry-point check — codedb-bridge, supabase/cloudflare exporters and the claimant installer silently no-op via any symlink #4325, proxy-supervise: main() never runs when invoked via a symlinked path (~/code -> ~/git/code) — supervisor timer silently no-ops since 2026-10-27 #2083, bin: provider-catalog-sync and record still use the pre-#2083 raw-path entry-point check — invoked via any symlink they silently no-op with exit 0 #2235, meta-exporter: meta-quota-export still uses the pre-#2083 raw-path entry-point check — invoked via any symlink it silently no-ops with exit 0 #2350
  3. dezren39
    added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    and removed
    status/needs-triageNot yet triaged; needs a first look
    queue/queuedHas a queued queue task
    on Nov 3, 2026
  4. dezren39 commented on Nov 3, 2026

    @dezren39
    dezren39
    on Nov 3, 2026
    MemberAuthor
    More actions

    agent-note:v1
    event: picked_up
    task: 6673 (repo-health-code-pilot, lane 8ac61616-3815-4e7b-b33d-840a3829154a)
    state: claimed via atomic queue claim at 2026-11-02 19:02 CST; issue #4694 is OPEN with no hard-stop labels. Search found no PR referencing #4694; #4668 is Drew-authored and changes only the unrelated opencode-config-guard workflow, so it will not be touched.
    next: verify the reported symlink no-op against fresh main, then route the narrowly scoped fix and regression tests without duplicating #4325.

  5. dezren39 commented on Nov 3, 2026

    @dezren39
    dezren39
    on Nov 3, 2026
    MemberAuthor
    More actions

    agent-note:v1
    event: done
    task: 6673 (repo-health-code-pilot, lane 8ac61616-3815-4e7b-b33d-840a3829154a)
    state: triaged; reproduced and routed as follow-up task 6674 (small_fix).
    evidence (fresh origin/main 9dfc29e, 2026-11-03): direct invocation on deepseek/deepseek-chat exits 1 with the metered-provider failure; file-symlink and symlinked-directory invocations both exit 0 silently; direct clean-config control exits 0 with pass output.
    related work: PR #4583 for #4325 is OPEN and changes four other entry points, not this guard. Cross-linking #4694 into #4325 for visibility; follow-up scope stays separate.
    next: task 6674 changes only this guard and its regression tests; #4694 remains OPEN pending that fix.

  6. dezren39
    added
    task/small-fixQueue packet kind: bounded fix with reproduction and targeted tests
    queue/queuedHas a queued queue task
    and removed
    task/triageQueue packet kind: verify, reproduce, and route this item
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 3, 2026
  7. dezren39 commented on Nov 3, 2026

    @dezren39
    dezren39
    on Nov 3, 2026
    MemberAuthor
    More actions

    🤖 Agent note · picked up

    • Agent: queue worker (repo-worker-code), lane code-c
    • Session / ID: task 6674
    • Found via: queue claim
    • Task: fix the metered-provider guard's entry-point check so it runs through symlinks, for issue check-opencode-metered-providers: entry-point check uses resolve() not realpath — invoked via any symlink the PAYG guard silently no-ops with exit 0 #4694
    • State: revalidated fresh 2026-11-03T01:18Z: issue check-opencode-metered-providers: entry-point check uses resolve() not realpath — invoked via any symlink the PAYG guard silently no-ops with exit 0 #4694 OPEN, labels already claim-synced, no hard stops; PR fix: handle symlinked entry points (#4325) #4583 (bin+pm-stack: four entry points still use the pre-#2083 raw-path entry-point check — codedb-bridge, supabase/cloudflare exporters and the claimant installer silently no-op via any symlink #4325) does not touch this file. Fix per the proven pattern: realpathSync on both sides of the entry-point comparison (bin/proxy-supervise.mjs / fix(bin): run main when provider-catalog-sync and record are invoked via symlink (#2235) #4123), plus symlink regression tests (file + directory, metered + clean) in bin/check-opencode-metered-providers.test.mjs.
    • Links: issue bin+pm-stack: four entry points still use the pre-#2083 raw-path entry-point check — codedb-bridge, supabase/cloudflare exporters and the claimant installer silently no-op via any symlink #4325 (cross-link) · PR fix: handle symlinked entry points (#4325) #4583 · task 6674
  8. dezren39
    added a commit that references this issue on Nov 3, 2026

    Merge pull request #4697 from developing-today/queue/6674-4694-metere…

    40c5d40
  9. dezren39
    closed this as completedin #4697on Nov 3, 2026
  10. dezren39 commented on Nov 3, 2026

    @dezren39
    dezren39
    on Nov 3, 2026
    MemberAuthor
    More actions

    🤖 Agent note · done — PR #4697 merged, issue #4694 closed

    • Agent: queue worker (repo-worker-code), lane code-c
    • Session / ID: task 6674
    • Result: PR fix(bin): run the metered-provider guard through symlinks (#4694) #4697 merged, merge commit 40c5d40. The guard's entry-point check now compares realpathSync on both sides (fail-closed to not-main on resolution error), so symlinked invocation runs the guard and library import stays inert.
    • Tests: node --test bin/check-opencode-metered-providers.test.mjs — 17/17 pass on the laptop (13 existing + 4 new: file-symlink metered/clean, directory-symlink metered, import-inert).
    • Cross-link: posted on bin+pm-stack: four entry points still use the pre-#2083 raw-path entry-point check — codedb-bridge, supabase/cloudflare exporters and the claimant installer silently no-op via any symlink #4325 (comment 6592701852) with the suggested widened grep for this entry-point shape.
    • CI note: the PR's basic guard check stayed queued (repo-wide Actions runner jam, issue main-broken: developing-today/code id @bd88019 — nix flake check #2186 / task 6603); merged under the standing merge authority after laptop verification.
    • Links: PR fix(bin): run the metered-provider guard through symlinks (#4694) #4697 · bin+pm-stack: four entry points still use the pre-#2083 raw-path entry-point check — codedb-bridge, supabase/cloudflare exporters and the claimant installer silently no-op via any symlink #4325 · task 6674
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/check-opencode-metered-providersbin/check-opencode-metered-providers.mjs metered PAYG provider guardapp/pm-stackpm-stack (Pad/Grist) in developing-today/codeeffort/xsTrivial: expected under 30 minutes of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)queue/queuedHas a queued queue tasksource/creatorFiled by the new-issue-creator jobtask/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.