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 — model-governance: agentDefinitions skips non-document entries — Markdown-defined agents escape governance resolution (PR #468 Codex P1 unaddressed) · Issue #1107 · developing-today-forks/opencode

model-governance: agentDefinitions skips non-document entries — Markdown-defined agents escape governance resolution (PR #468 Codex P1 unaddressed) #1107

New issue
Copy link
New issue
Copy link
Closed
#1165
Closed
model-governance: agentDefinitions skips non-document entries — Markdown-defined agents escape governance resolution (PR #468 Codex P1 unaddressed)#1107
#1165
Copy link
Labels
app/corePackage: core (pkgs/ or apps/ in this repo)priority/highImportant and time-sensitivesource/pr-comment-reviewFiled by the pr-comment-review jobtask/triageQueue packet kind: verify, reproduce, and route this item

Description

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

Finding (from PR review, unaddressed)

On PR #468, Codex raised a P1 that was never fixed and never replied to:

Include Markdown agent definitions in governance resolution — For agents defined in .opencode/agents/*.md, this skips the directory entry containing their definitions. ConfigAgentPlugin.loadEntry separately discovers and decodes those Markdown files, including the new governance fields, but does not insert them here.
— chatgpt-codex-connector[bot], 2026-10-26T01:21:15Z

Evidence:

  • PR: feat(core): subsession model governance #468
  • Comment: feat(core): subsession model governance #468 (comment) (packages/core/src/session/model-governance.ts:36)
  • No-response evidence: the comment thread has no reply, and no open issue covers this specific gap (searched open issues for agentDefinitions / governance / markdown on 2026-10-31).

Scope note (sibling finding on the same PR): a different governance gap from PR #468 — Session.AgentOverride subagentModels/subagentExcludedModels being accepted by the schema but never enforced — was tracked and closed as opencode#478. This issue covers only the agentDefinitions document-only gap below; it is not a reopening of #478.

Still live on current main (verified 2026-10-31)

packages/core/src/session/model-governance.ts on current main still opens agentDefinitions with:

for (const entry of entries) {
  if (entry.type !== "document") continue
  ...
}

Every non-document entry is skipped, so agents defined in .opencode/agents/*.md never enter the definitions map and escape governance resolution — exactly what the reviewer flagged.

Acceptance criteria

  • Agents defined in .opencode/agents/*.md appear in agentDefinitions' output with their governance fields (model pins/exclusions) honoured by governance resolution.
  • Document-defined agents behave exactly as before.
  • A test pins a Markdown-defined agent flowing through governance resolution.
  • Or: resolve by a documented decision on this issue explaining why Markdown-defined agents are intentionally outside definition-layer governance.

Activity

Next
  1. dezren39
    added
    task/triageQueue packet kind: verify, reproduce, and route this item
    status/needs-triageNot yet triaged; needs a first look
    priority/highImportant and time-sensitive
    queue/queuedHas a queued task in the Supabase agent queue
    app/corePackage: core (pkgs/ or apps/ in this repo)
    source/pr-comment-reviewFiled by the pr-comment-review job
    on Oct 31, 2026
  2. dezren39 commented on Oct 31, 2026

    @dezren39
    dezren39
    on Oct 31, 2026
    Author
    More actions

    🤖 Agent note · filed

    • Agent: pr-comment-review job (enumeration filing, Drew-approved 2026-10-31)
    • Session / ID: pr-comment-review enumeration filing, 2026-10-31
    • Found via: unaddressed Codex PR comment — feat(core): subsession model governance #468 (comment)
    • Task: Filed this issue for the unaddressed Codex P1 on PR feat(core): subsession model governance #468 (agentDefinitions skips non-document entries; Markdown agents escape governance). Distinct from closed fix(core): Session.AgentOverride subagentModels/subagentExcludedModels are accepted by the schema but never enforced (PR #468) #478 (a sibling feat(core): subsession model governance #468 gap). Triage packet enqueued to repo-health-opencode-pilot.
    • Expectation: effort class m — done = Markdown-defined agents flow through governance resolution, or a documented decision on the issue.
    • Links: source PR feat(core): subsession model governance #468 · sibling tracked gap fix(core): Session.AgentOverride subagentModels/subagentExcludedModels are accepted by the schema but never enforced (PR #468) #478 (closed)
  3. dezren39
    added
    queue/claimedA queue worker has claimed the task for this item
    status/in-progressActively being worked
    work/assignedAn agent holds this item via the queue (claimed task)
    and removed
    status/needs-triageNot yet triaged; needs a first look
    queue/queuedHas a queued task in the Supabase agent queue
    on Oct 31, 2026
  4. dezren39 commented on Oct 31, 2026

    @dezren39
    dezren39
    on Oct 31, 2026
    Author
    More actions

    Triage (queue task 4692, lane A): CONFIRMED on current main, with the mechanism pinned:

    • packages/core/src/session/model-governance.ts — agentDefinitions skips every entry with entry.type !== "document", and every governance caller passes raw entries: checkedModel and assertAllowed in the same file, and SubagentDepth.assertWithinLimit (packages/core/src/session/subagent-depth.ts:37), all call agentDefinitions(yield* config.entries()).
    • packages/core/src/config.ts (loadDirectory) emits one Directory entry (type: "directory") per config directory alongside the Document entries — the .md agent files inside a directory are never entries themselves.
    • packages/core/src/config/plugin/agent.ts (loadEntry) is the only place directory entries are expanded: it discovers {agent,agents}/**/*.md and {mode,modes}/*.md, decodes each file into a Document, and applies the agents' model / models / excluded_models / subagent lists / max_depth to the agent editor — a path governance never reads.

    So a Markdown-defined agent runs with its configured fields on the agent object, but the governance definition layer never sees them: its model pin is not the governance-checked default, and its exclusions, subagent lists and depth cap do not bind in assertAllowed / depth resolution. This is the PR #468 Codex P1 (discussion_r4373269886); the sibling Session.AgentOverride gap was closed separately as #478 and is out of scope here.

    Fix enqueued as queue task 4704 (small_fix): make Markdown-defined agents visible to the governance definition layer, with a regression test in packages/core/test/session-governance.test.ts pinning a Markdown-defined agent through governance resolution.

  5. dezren39
    removed
    status/in-progressActively being worked
    queue/claimedA queue worker has claimed the task for this item
    on Oct 31, 2026
  6. 22 remaining items

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

    fix(core): expose FSUtil in the location graph for governance load (#…

    4d698ad
  8. dezren39 commented on Nov 1, 2026

    @dezren39
    dezren39
    on Nov 1, 2026
    Author
    More actions

    Codex P1 on PR #1165 (FSUtil not exposed in the production location context, so GovernanceConfig.load silently skipped Markdown expansion in production) is fixed in 4d698ad: the instance graph now re-provides FSUtil.layer as a location root, and a new regression test drives GovernanceConfig.load through the production location graph. Both review threads (Codex P1, CodeRabbit Major) replied and resolved; Codex re-review requested on the new head. Parked pending that re-review.

  9. dezren39
    added
    status/parkedDeliberately paused with a recorded resume condition
    and removed
    status/in-progressActively being worked
    on Nov 1, 2026
  10. dezren39 commented on Nov 1, 2026

    @dezren39
    dezren39
    on Nov 1, 2026
    Author
    More actions

    Claimed task 4704 and revalidated GitHub. PR #1165 is open and Drew-owned, so the lane hard stop forbids touching it. Parked for 30 minutes pending ownership change or merge; the existing branch and worktree remain untouched.

  11. dezren39
    added
    queue/claimedA queue worker has claimed the task for this item
    status/in-progressActively being worked
    and removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Nov 1, 2026
  12. dezren39
    added a commit that references this issue on Nov 1, 2026

    Merge pull request #1165 from developing-today/queue/4704-1107-markdo…

    792fb82
  13. dezren39
    closed this as completedin #1165on Nov 1, 2026
  14. dezren39
    removed
    status/in-progressActively being worked
    queue/claimedA queue worker has claimed the task for this item
    work/assignedAn agent holds this item via the queue (claimed task)
    on Nov 1, 2026
  15. dezren39 commented on Nov 1, 2026

    @dezren39
    dezren39
    on Nov 1, 2026
    Author
    More actions

    Merged via PR #1165 (merge commit 792fb82). Codex review on head 4d698ad completed clean (has_any_findings=false, has_unresolved_findings=false); the earlier Codex P1 (FSUtil visibility in the location graph) was fixed in that head and acknowledged on its thread. Markdown-defined agents are now visible to the governance definition layer. Queue task 4704 completed (fixed_merged).

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/corePackage: core (pkgs/ or apps/ in this repo)priority/highImportant and time-sensitivesource/pr-comment-reviewFiled by the pr-comment-review jobtask/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.