Skip to content

feat: OpenCode Go local-first Auto, adaptive refresh, cost JSONL tails (0.45 deferred)#230

Closed
Finesssee wants to merge 1 commit into
mainfrom
port/045-deferred-local
Closed

feat: OpenCode Go local-first Auto, adaptive refresh, cost JSONL tails (0.45 deferred)#230
Finesssee wants to merge 1 commit into
mainfrom
port/045-deferred-local

Conversation

@Finesssee

@Finesssee Finesssee commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

Ports three deferred 0.45 items onto the Tauri/Windows tree:

1. OpenCode Go local-first Auto (upstream steipete#2316)

  • New rust/src/providers/opencodego/local.rs reads local opencode.db via rusqlite
  • Paths: %USERPROFILE%\.local\share\opencode\, %LOCALAPPDATA%\opencode\, $HOME/.local/share/opencode/
  • Session $12/5h, weekly $30, monthly $60 cost windows; prefers step-finish parts when present
  • Auto: local first unless workspace_id / token-account / manual cookie scopes web first
  • Web: web only; Cli: local only
  • available_sources: Auto, Web, Cli

2. Adaptive refresh (upstream AdaptiveRefreshPolicyCore)

  • Pure policy module rust/src/core/adaptive_refresh.rs with the decision table
  • Settings flag adaptive_refresh + General tab Adaptive option
  • auto_refresh.rs uses adaptive delays when enabled; tracks last menu open / activity
  • Windows low-power: simple battery/AC + battery-saver heuristic (nominal thermal)

3. Cost incomplete tails

  • Claude cost scanner uses read_until so a final incomplete JSONL line is processed when valid UTF-8 JSON

Tests

cargo test --manifest-path rust/Cargo.toml --lib opencodego
cargo test --manifest-path rust/Cargo.toml --lib adaptive_refresh
cargo test --manifest-path rust/Cargo.toml --lib claude_scan_counts_final
cargo test --manifest-path rust/Cargo.toml --lib locale::
cargo test --manifest-path rust/Cargo.toml --lib settings::
cargo test --manifest-path apps/desktop-tauri/src-tauri/Cargo.toml auto_refresh -- --test-threads=1

Notes

  • No packaging / version bump

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

Port deferred 0.45 work: SQLite local usage for OpenCode Go (steipete#2316) with
Auto local-first (web-first when scoped), Adaptive refresh policy + UI
option, and Claude cost scanner incomplete trailing JSONL line support.
@github-actions

Copy link
Copy Markdown

This repository allows each user to open at most 4 pull requests per 7 days.

Closing this automatically.

@github-actions github-actions Bot closed this Jul 21, 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