Skip to content

fix(opencode): use the configured resolver in ConversationProvider::load_conversation#122

Open
akesling wants to merge 1 commit into
mainfrom
fix/opencode-trait-resolver
Open

fix(opencode): use the configured resolver in ConversationProvider::load_conversation#122
akesling wants to merge 1 commit into
mainfrom
fix/opencode-trait-resolver

Conversation

@akesling

@akesling akesling commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Root cause

OpencodeConvo::load_conversation (the ConversationProvider trait path) called to_view(&s), which constructs a fresh default PathResolver instead of using the instance's configured one. With any non-default data dir, the snapshot bare git repo is never found, and every file diff silently degrades to the structural-only tool-input fallback — no raw perspective, no error, no warning.

Fix

load_conversation now calls to_view_with_resolver(&s, self.resolver()). The other trait methods (list_conversations, load_metadata, list_metadata) never build views, so this was the only affected call site.

Tests

New trait-path integration test (TDD; red before the fix): builds a real bare snapshot repo at the exact path resolver.snapshot_gitdir(...) computes (git2 init_bare, real blob/tree/commits wired into the session's step-start/step-finish snapshot fields) and asserts load_conversation yields a FileMutation with raw_diff.is_some() — a fresh default resolver misses the temp gitdir and fails this.

Full workspace suite + clippy green. toolpath-opencode bumped 0.5.0 → 0.5.1 (crate, workspace dep, crates.json, CHANGELOG, Cargo.lock).

Notes

  • Part of a six-PR consistency series from a cross-harness audit; CHANGELOG/version lines may conflict with sibling fix PRs — resolve by keeping both entries.
  • No path-cli/toolpath-cli bump here; one release bump lands after the series merges.

View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

🔍 Preview deployed: https://fa451051.toolpath.pages.dev

akesling added a commit that referenced this pull request Jul 8, 2026
Behavior-adding changes on this branch (pi metadata entries via events;
opencode user model + snapshot-SHA events). The .1 patch numbers are
claimed by sibling PRs #121/#122 currently in flight, so both crates
skip to .2. All five sites updated: crate Cargo.toml, root workspace
dependency, site/_data/crates.json, CHANGELOG top section, Cargo.lock.
No path-cli / toolpath-cli / toolpath-convo bumps.
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