Skip to content

feat(opencode): publish structured native-driver diagnostics - #362

Merged
schickling-assistant merged 1 commit into
mainfrom
schickling-assistant/2026-08-27-opencode-driver-diagnostics
Aug 27, 2026
Merged

feat(opencode): publish structured native-driver diagnostics#362
schickling-assistant merged 1 commit into
mainfrom
schickling-assistant/2026-08-27-opencode-driver-diagnostics

Conversation

@schickling-assistant

Copy link
Copy Markdown
Contributor

Problem

Managed OpenCode native delivery can fail at version, API, SSE/seed, submission, or read-back boundaries. st2 currently exposes many failures only on stderr, so Fractal/Doctor cannot explain why native delivery or exact observation is unavailable, and telemetry cannot measure recovery.

Goal

Publish one typed current driver diagnostic with stable bounded vocabulary, stage-local recovery, roster/Doctor exposure, and privacy/cardinality-safe telemetry—without changing OpenCode delivery/retry/archive behavior or introducing launcher vocabulary.

Design

Durable per-agent record:

{
  "schema":"st2.driver-diagnostic.v1",
  "driver":"opencode",
  "stage":"versionGate|apiGate|sse|seed|delivery|readBack",
  "reason":"<closed enum>",
  "source":"<closed enum>",
  "support":"supported|unsupported|unknown",
  "observedAt":1787830000000,
  "recovery":"clearsOnStageRecovery"
}
  • additive fields tolerated; malformed/unknown/future-skew records become visible indeterminate
  • same tuple deduplicates
  • recovery clears only its stage, revealing the next earliest failure; final recovery removes the file
  • roster adds driverDiagnostic; Doctor emits actionable advisory
  • telemetry span/event + driver_diagnostic_transitions_total uses only bounded stage/reason/source/support/outcome axes
  • raw version and correlation IDs are span/log-only; no identities, paths, prompts, message bodies, filenames, or IDs in metric labels/span.label

Verification

  • Diagnostic core/wire/cardinality: 5 tests green.
  • OpenCode fake-server suite: 25 tests green.
  • Roster: 4 tests green.
  • Doctor structured agreement/recovery: green.
  • nix build .#default --no-link: green (/nix/store/nmk0d7lcyqfg992qybq36vnb4kn4apsx-st2-0.1.0).
  • Strict VRS reports only existing baseline malformed records; no new diagnostic artifact errors.

Complexity

One generic typed diagnostic core plus OpenCode boundary adapters. The generic reader/telemetry does not branch on Axe or launcher identity. Delivery state machine is unchanged.

Concerns

The current reason vocabulary is intentionally closed. New provider failure classes must extend schema/tests deliberately rather than leak error strings. Raw producer version remains roster/drawer data but is excluded from metric labels.

References

  • Dependency for schickling/dotfiles#2090
  • Decisions q10/q11/q12 in downstream decision tree
Posted on behalf of @schickling
field value
agent_identity unknown
agent_persona generalist
agent_supervisor unavailable
agent_tool OMP
agent_tool_version 18.0.3
agent_runtime OMP 18.0.3
tooling_profile dotfiles@e4789b0

Persist one typed current diagnostic across version/API/SSE/seed/delivery
and read-back boundaries, with stage-local recovery clearing and earliest
failure precedence. Expose the shared model in roster and Doctor; emit
bounded spans/events/counter attributes without identities, paths, messages,
or raw versions in metric labels. Delivery/retry/archive semantics remain
unchanged.

Includes the user-confirmed full VRS contract and decision amendment.

agent-identity: unknown
agent-persona: generalist
agent-supervisor: unavailable
agent-tool: OMP
agent-tool-version: 18.0.3
agent-runtime: OMP 18.0.3
tooling-profile: dotfiles@e4789b0
@schickling-assistant schickling-assistant added the type:feature New user-visible or system capability · Set: manual label Aug 27, 2026
@schickling-assistant
schickling-assistant merged commit 2167ef3 into main Aug 27, 2026
2 checks passed
@schickling-assistant
schickling-assistant deleted the schickling-assistant/2026-08-27-opencode-driver-diagnostics branch August 27, 2026 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:feature New user-visible or system capability · Set: manual

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant