Skip to content

feat(drive): ship verified dynamic tool lifecycle example#45

Open
kitlangton wants to merge 1 commit into
mainfrom
test/tool-producer-model
Open

feat(drive): ship verified dynamic tool lifecycle example#45
kitlangton wants to merge 1 commit into
mainfrom
test/tool-producer-model

Conversation

@kitlangton

@kitlangton kitlangton commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

What

Add generated state-machine coverage for ToolProducer and ship a runnable dynamic-tool example covering progress, cancellation, and terminal completion.

Before / After

Before: Dynamic tool lifecycle behavior had strong focused regressions, but no generated coverage across attachment replacement, reconnects, invocations, cancellation, settlement, and generation changes. The documented example was an inline happy path and was not shipped in the package.

After: An in-memory backend drives hundreds of deterministic generated operation sequences through the real producer, and consumers get a contract-checked packaged example with both completion and cancellation paths.

stateDiagram-v2
  [*] --> Attached
  Attached --> Invoked
  Invoked --> Progress
  Progress --> Finished
  Invoked --> Failed
  Invoked --> Cancelled
  Attached --> Reattached: reconnect
  Invoked --> Cancelled: generation ends
Loading

How

  • Adds 250 generated lifecycle sequences covering attach acknowledgement/rejection, disconnect/reconnect replay, invocation claiming, progress sequencing, finish/fail, cancellation, generation end, failed settlement, successful settlement, and terminal closure.
  • Adds 20 generated retention runs proving unclaimed cancellation state remains bounded and evicted identities can be reused.
  • Narrows the internal producer backend seam to the lifecycle capabilities it consumes while preserving concrete connectFrom backend subtypes.
  • Adds examples/dynamic-tool.ts, including input decoding, progress, cancellation handling, terminal completion, and a follow-up model response.
  • Ships the examples directory and documents the runnable command.
  • Adds a patch changeset for opencode-drive.

Scope

Limited to ToolProducer lifecycle verification, its internal backend dependency, and dynamic-tool adoption material. No simulation protocol or CLI command shapes change, and publishing remains deferred.

Testing

  • opencode-drive check ./examples/dynamic-tool.ts passes.
  • bun run release:validate passes: 31 Effect files / 204 tests, 57 CLI tests, lint, typecheck, and a 100-file package dry-run.
  • Focused model tests run 250 lifecycle sequences and 20 retention cases.
  • The packed artifact includes all five runnable examples.
  • GitHub CI passes on commit 61d7c10.

@kitlangton kitlangton changed the title test(drive): model dynamic tool lifecycles feat(drive): ship verified dynamic tool lifecycle example Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant