fix(sleep): add Windows AppData support for default OpenCode database discovery (#56) - #230
Merged
Yifan Yang (Yif-Yang) merged 1 commit intoAug 20, 2026
Conversation
Yifan Yang (Yif-Yang)
added a commit
that referenced
this pull request
Aug 20, 2026
Two defects that shipped with the merged PRs: harvest_opencode: the APPDATA branch added by #230 was unreachable. `LOCALAPPDATA or APPDATA` resolves to the former in virtually every Windows session, so a database that really lives under Roaming was never found. Probe the candidate roots in order and pick the one that holds opencode.db, falling back to the Local root for messaging when no database exists yet; a relative OPENCODE_DB resolves below the same selected root. minimax_backend: configure_minimax_chat applied the region default unconditionally and wrote it into MINIMAX_BASE_URL, so a proxy or private gateway configured through the environment was silently discarded as soon as model.minimax_region was set — trainer and eval_only pass `cfg.get('minimax_base_url') or None`, i.e. None for the common case. Track whether the base URL was chosen explicitly and only fill in the region default when it was not, matching what the docs already state. Co-authored-by: Yif-Yang <Yif-Yang@users.noreply.github.com> Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #56 by adding native Windows
%LOCALAPPDATA%and%APPDATA%environment variable resolution todefault_opencode_db().When running on Windows systems with
XDG_DATA_HOMEunset,skillopt-sleep --source opencodepreviously defaulted to~/.local/share/opencode/opencode.db(a POSIX path that does not exist on native Windows). OpenCode on Windows stores its database under%LOCALAPPDATA%\opencode\opencode.dbor%APPDATA%\opencode\opencode.db.Key Changes :-
skillopt_sleep/harvest_opencode.py:default_opencode_db()to inspectsys.platform == "win32"and checkLOCALAPPDATAandAPPDATAenvironment variables before falling back to~/.local/share.tests/test_harvest_opencode.py:test_default_database_honors_windows_appdatato verify Windows environment variable path resolution fordefault_opencode_db().Documentation (
docs/reference/cli.md&plugins/README.md):%LOCALAPPDATA%/%APPDATA%default database path auto-discovery.Verification
pytest tests/test_harvest_opencode.py(28/28 passed).ruff check skillopt_sleep/harvest_opencode.py tests/test_harvest_opencode.py(All checks passed!).