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-config-normalize: agents-only config silently loses every agent — the agents block is dropped even when the merge splice never lands · Issue #2364 · developing-today/code

opencode-config-normalize: agents-only config silently loses every agent — the agents block is dropped even when the merge splice never lands #2364

New issue
Copy link
New issue
Copy link
Closed
#3002
Closed
opencode-config-normalize: agents-only config silently loses every agent — the agents block is dropped even when the merge splice never lands#2364
#3002
Copy link
Assignees
dezren39
Labels
app/opencode-config-normalizePackage/app: opencode-config-normalize (pkgs/ or apps/ in this repo)effort/xsTrivial: expected under 30 minutes of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/highImportant and time-sensitivesource/creatorFiled by the new-issue-creator jobtask/fixhas a fix task queuedtask/triageQueue packet kind: verify, reproduce, and route this item

Description

@dezren39
dezren39
opened on Oct 29, 2026
Issue body actions

Problem

pkgs/opencode-config-normalize/normalize.sh silently deletes every agent definition from a config that has an agents key but no agent key — which is exactly the shape OpenChamber's v1→v2 migration produces (the script's own header: OpenChamber migrates agent -> agents). The script reports "repaired" and exits 0 while the user's agents vanish, so the v1 CLI loses all its agent definitions — the opposite of the script's purpose.

Evidence (verified this run on main 5a34fa70)

  • normalize.sh:52-68 (embedded Python): when 'agents' in doc, it computes merged = {**agents, **agent} and, if merged != agent, tries to splice the merged map into the existing "agent" block with the regex "agent"(\s*):\s*\{.*?\n \} (lines 61-65). When there is no "agent" key, that regex cannot match ("agents" does not match "agent" + closing quote), so nothing is inserted and n = 0.
  • The drop on line 67 then runs unconditionally: re.subn(r'\n\s*"agents"\s*:\s*\{.*?\n \},?', '', out, count=1, ...) removes the agents block regardless of whether the merge splice succeeded, and sets changed, so the mutilated text is written after only a parse check (lines 73-79) that cannot detect the loss.
  • Probe (this run, /tmp/probe-laneB-normalize/, script run with OPENCODE_CONFIG pointed at a copy): input with only agents (build + plan entries) and plugins came out as just { "$schema": ..., "plugin": ["opencode-plugin-x"] } — both agents gone, no agent key created, stderr opencode-config-normalize: repaired ..., exit 0.
  • Controls in the same probe: a config with a standard pretty-printed agent block plus agents merges correctly, and a single-line "agent": {} also merges correctly — the loss is specific to the agents-only shape (and to any shape where the splice regex misses while the drop regex hits).

Why it matters

This script runs unattended (it is designed for a path-unit trigger on the live ~/.config/opencode/opencode.jsonc) precisely after OpenChamber launches — i.e. precisely when the config is most likely to be in the agents-only v2 shape. Each such launch can irreversibly strip every custom agent (models, prompts, permissions) from the shared config with no error, no backup, and a "repaired" log line. A repair tool must never be a data-loss path.

Acceptance criteria

  • An agents-only config gains an agent block containing every agents entry (same merge precedence: existing agent wins per key) and loses the agents block — no entry is dropped.
  • The agents block is removed only after its contents are verifiably present in the resulting agent block; if the splice/insert cannot be performed, the file is left byte-identical (no write, non-zero or silent no-op per the script's existing conventions — pin one).
  • Regression fixtures: agents-only (2-space pretty), agent+agents merge (existing behaviour preserved), plugins-only rename, and an unparseable file left untouched; each asserts the full parsed document, not just substrings.
  • Idempotence preserved: running the script on its own output is a no-op.

Dedup

Searched open + closed issues for opencode-config-normalize, "normalize opencode config agents", and the script path: no issue covers this script's agents handling. #704 (closed) is a different tool (sync-models) with a different JSONC parser; #730 is v2 schema validation of .opencode project config, not this normalizer.

Activity

Next
  1. dezren39
    added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    priority/highImportant and time-sensitive
    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
    app/opencode-config-normalizePackage/app: opencode-config-normalize (pkgs/ or apps/ in this repo)
    effort/xsTrivial: expected under 30 minutes of work
    on Oct 29, 2026
  2. dezren39 commented on Oct 29, 2026

    @dezren39
    dezren39
    on Oct 29, 2026
    MemberAuthor
    More actions

    🤖 Agent note · filed

    • Agent: new-issue-creator job (lane B, new-issue-creator-code-b)
    • Session / ID: cron new-issue-creator-code-b, run 2026-10-29 10:20 CDT
    • Found via: filed this run
    • Task: Triage the agents-only data-loss in pkgs/opencode-config-normalize/normalize.sh: pin the insert-vs-abort rule, then route the small fix (drop the agents block only after its contents land in agent; insert an agent block when none exists) with regression fixtures.
    • Expectation: effort xs; done = triage packet routed with the acceptance criteria on the issue.
    • Links: evidence/probe in the issue body; queue packet enqueued this run.
  3. github-actions
    assigned
    dezren39
    on Oct 29, 2026
  4. dezren39
    added
    queue/claimedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    and removed
    status/needs-triageNot yet triaged; needs a first look
    queue/queuedHas a queued queue task
    on Oct 31, 2026
  5. 13 remaining items

  6. dezren39
    added
    status/parkedDeliberately paused with a recorded resume condition
    and removed
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    on Oct 31, 2026
  7. dezren39 commented on Oct 31, 2026

    @dezren39
    dezren39
    on Oct 31, 2026
    MemberAuthor
    More actions

    🤖 Agent note · parked

    • Agent: queue worker (repo-worker-code), lane D
    • Session / ID: queue task 4335
    • Found via: queue claim
    • Task: Parked on CI — PR fix(opencode-config-normalize): never drop agents that did not land in agent (#2364) #3002 opened at 4425572; no Actions checks had started at 09:36Z (fleet runner backlog). Fixture suite passes 6/6 on the laptop.
    • Expectation: Resume when CI is green and any Codex findings are dispositioned → merge PR fix(opencode-config-normalize): never drop agents that did not land in agent (#2364) #3002 → complete task 4335 as fixed_merged.
    • Links: PR fix(opencode-config-normalize): never drop agents that did not land in agent (#2364) #3002
  8. dezren39
    added
    queue/claimedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    and removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Oct 31, 2026
  9. dezren39 commented on Oct 31, 2026

    @dezren39
    dezren39
    on Oct 31, 2026
    MemberAuthor
    More actions

    agent-note:v1
    state: picked up
    task: 4335 (repo-health-code-pilot, lane A)
    artifact: PR #3002 @ 4425572
    note: Resume from awaiting_ci. Fresh verification: no CI workflow covers pkgs/opencode-config-normalize (code search over .github is empty; the PR has only a neutral CodeRabbit check after >1h, so no Actions check will ever start — parking on CI was a loop). Codex state marker on this head: has_any_findings=false, has_unresolved_findings=false. Fixture suite re-run by this lane on the laptop at 4425572: 6/6 PASS (agents-only, agents-last, merge, plugins-only, unparseable, unrecognised). Diff reviewed: insert path + verify-before-write full-document gate match the acceptance criteria. Merging under the standing directive.

  10. dezren39
    added a commit that references this issue on Oct 31, 2026

    Merge pull request #3002 from developing-today/queue/4335-2364-normal…

    6bbb065
  11. dezren39
    closed this as completedin #3002on Oct 31, 2026
  12. dezren39
    removed
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Oct 31, 2026
  13. dezren39 commented on Oct 31, 2026

    @dezren39
    dezren39
    on Oct 31, 2026
    MemberAuthor
    More actions

    agent-note:v1
    state: done
    task: 4335 (repo-health-code-pilot, lane A)
    outcome: fixed_merged — PR #3002 merged (6bbb065), this issue closed. Verification: fixture suite 6/6 PASS on the laptop at the merged head; Codex clean on the head; no CI workflow covers this path (noted on the pickup note).

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

Metadata

Metadata

Assignees

  • @dezren39
    dezren39

Labels

app/opencode-config-normalizePackage/app: opencode-config-normalize (pkgs/ or apps/ in this repo)effort/xsTrivial: expected under 30 minutes of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/highImportant and time-sensitivesource/creatorFiled by the new-issue-creator jobtask/fixhas a fix task queuedtask/triageQueue packet kind: verify, reproduce, and route this item

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.