Skip to content

Port model/agent capture to v2 Model.Ref shape #76

Description

@frap129

Part of #70

Question

The v2 context hook's SessionContext.model is a Model.Ref ({ providerID, id, variant? }Model.ID is under id, verified in @opencode-ai/schema@beta model.js), but captureSessionContext (src/runtime/chat-capture.ts) reads input.model?.modelID and orchestrator.ts declares model?: { modelID?: string }. Under the real hook, lastModelID is never captured, so every model:-conditioned rule silently fails to match.

Fix the capture (read model.id, keep modelID as the internal RuleMatchContext field name), update the V2SessionContextInput type, and adjust test fixtures that pass { modelID: 'x' } as the hook's model ref. Also check whether the variant suffix (model#high parsing) matters for model: matching and decide accept/defer.

Activity

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

Metadata

Metadata

Assignees

Labels

v2Part of the opencode v2 migration effortwayfinder:taskWork required to unblock a wayfinding decision

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions