Skip to content

plugin API: v2 plugins cannot list child sessions, read live provider pricing, or learn the server URL #19

Closed

Description

@dezren39

Porting the tokenscope plugin from v1 to v2 lost these features because the v2 plugin Context (packages/plugin/src/promise/plugin.ts) has no equivalent for them:

  • Child sessions: no way to enumerate a session's subagent sessions, so there is no per-subagent cost breakdown.
  • Provider pricing: no access to live model pricing; the plugin falls back to a bundled models.json.
  • Agent/skill catalog: no way to estimate the token cost of the agent and skill catalog.
  • Server URL: v1 passed serverUrl (plus client); v2 passes neither, so anything that called the HTTP API from a plugin can't.
  • Context window: ctx.session.context only returns messages since the last compaction.

Request: expose read-only APIs for these, or document the intended replacement.

Acceptance criteria

  • A v2 plugin can enumerate a session's child (subagent) sessions read-only, or the issue is answered with the intended replacement API and the plugin-facing docs are updated.
  • A v2 plugin can read live provider/model pricing (the same data the server uses), instead of relying on a bundled models.json.
  • A v2 plugin receives the server URL (and an authenticated client or equivalent) as v1 did, so HTTP-API calls from plugins work again.
  • For each remaining gap (agent/skill catalog token cost, full pre-compaction session context), there is either an API or a documented, intentional 'not supported' decision recorded on this issue.

Activity

  1. dezren39 commented on Oct 27, 2026

    @dezren39
    Author

    Intake review

    Filed by Drew 2026-10-17 while porting the tokenscope plugin from v1 to v2: five concrete API losses in the v2 plugin Context (packages/plugin/src/promise/plugin.ts). Still live at intake — no merged PR found restoring any of the five, and the issue has had no triage labels until now. Effort/l: this is plugin-API design + implementation across several surfaces, and it needs a maintainer-shaped decision on what the v2 API should expose (design first, then implement — a design note on the issue would unblock scoping). Related: the tokenscope port is the consumer; per-subagent cost breakdown is the headline use case.

    — Fleet monitor intake enrichment (protocol §5): acceptance criteria appended to the body where missing, labels normalised, meta/enriched added. Liveness checked against merged PRs / related issues at intake; no merged PR explicitly resolves this issue, so it stays open.

  2. added
    meta/enrichedIntake review done: acceptance criteria, links, and normalized labels added
    kind/featureNew feature or capability request
    source/humanFiled directly by a human
    priority/normalOrdinary priority (the default)
    effort/lLarge: multi-day or open-ended; expect staged check-ins
    work/assignedAn agent holds this item via the queue (claimed task)
    queue/claimedA queue worker has claimed the task for this item
    and removed on Oct 27, 2026
  3. dezren39 commented on Oct 28, 2026

    @dezren39
    Author

    🤖 Agent note · picked up

    • Agent: queue worker (repo-worker-opencode)
    • Session / ID: queue task 2048
    • Found via: queue claim
    • Task: Triage issue plugin API: v2 plugins cannot list child sessions, read live provider pricing, or learn the server URL #19 — verify the v2 plugin Context gaps (child sessions, live pricing, server URL, catalog, context) against current main, then route or close with evidence
    • Expectation: effort/l feature; triage done = per-gap verdict backed by code citation at HEAD plus scoped follow-up routing if confirmed
    • Links: queue task 2048
  4. dezren39 commented on Oct 28, 2026

    @dezren39
    Author

    🤖 Agent note · done

    • Agent: queue worker (repo-worker-opencode)
    • Session / ID: queue task 2048 (triage); follow-up fix task 2684
    • Found via: queue claim
    • Task: Triage verdict for issue plugin API: v2 plugins cannot list child sessions, read live provider pricing, or learn the server URL #19 — PARTIALLY CONFIRMED at current main; the confirmed remainder is routed to a scoped fix packet
    • Expectation: done = per-gap verdict backed by code citation at HEAD + follow-up packet enqueued (met)
    • Links: follow-up queue task 2684 (kind small_fix, dedupe repo-health:v1:fix:developing-today/opencode:issue:19)

    Per-gap verdict at HEAD 88ecd395ae846401b861c07413337a162f30f2c2 (2026-10-28):

    1. Child sessions — CONFIRMED (for plugins). The client SessionApi has list, and SessionListInput accepts a parentID filter (packages/client/src/effect/api/api.ts:121-135), but the plugin SessionDomain (packages/plugin/src/promise/session.ts) is a Pick<SessionApi, …> that omits list (and stats). A v2 plugin therefore cannot enumerate child sessions even though the server/client can.
    2. Server URL — CONFIRMED. The plugin Context interface (packages/plugin/src/promise/plugin.ts) exposes app, location, options and domain objects only — no serverUrl, no client. Anything that called the HTTP API from a v1 plugin still can't.
    3. Live pricing — NOT a gap at HEAD. Model.Info carries cost: Array<Cost> (input/output/cache, USD per million tokens — packages/schema/src/model.ts), ModelApi.list returns Model.Info[], and the plugin ModelDomain extends ModelApi. Pricing is already readable via ctx.model.list(); what is missing is documentation saying so.
    4. Agent/skill catalog — enumeration exists. AgentDomain/SkillDomain expose list() editors returning Agent.Info[]/Skill.Info[]. Token-cost estimation from those listings is plugin-side; this needs a documented decision, not a new API.
    5. Session context — context is in the plugin Pick; its post-compaction-only behaviour is left for the follow-up to document as intentional or file separately.

    Issue stays open; the fix (items 1–2 in code, 3–5 as documentation) is queued as task 2684.

  5. added
    queue/queuedHas a queued task in the Supabase agent queue
    and removed on Oct 28, 2026
  6. 16 remaining items

  7. added
    status/parkedDeliberately paused with a recorded resume condition
    and removed on Oct 29, 2026
  8. dezren39 commented on Oct 29, 2026

    @dezren39
    Author

    🤖 Agent note · parked

  9. added
    queue/claimedA queue worker has claimed the task for this item
    and removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Oct 29, 2026
  10. dezren39 commented on Oct 29, 2026

    @dezren39
    Author

    🤖 Agent note · state: done (merged)

  11. removed
    queue/claimedA queue worker has claimed the task for this item
    work/assignedAn agent holds this item via the queue (claimed task)
    on Oct 29, 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

    effort/lLarge: multi-day or open-ended; expect staged check-inskind/featureNew feature or capability requestmeta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedpriority/normalOrdinary priority (the default)source/humanFiled directly by a humanstatus:done

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions