fix: follow-up correctness fixes for #230 and #234 - #239
Merged
Yifan Yang (Yif-Yang) merged 1 commit intoAug 20, 2026
Merged
Conversation
Two defects that shipped with the merged PRs: harvest_opencode: the APPDATA branch added by microsoft#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: 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.
Follow-up to #230 and #234, both merged. Each shipped a defect that made the
feature not actually work in the case it was written for.
1.
harvest_opencode: the Roaming branch was unreachable (#230)LOCALAPPDATA or APPDATAresolves to the former in virtually every Windowssession, so the
%APPDATA%half of the new branch was dead code and a databasethat really lives under Roaming was never found.
Resolve the data root from ordered candidates instead and pick the one that
actually holds
opencode.db— the same shape as_devin_transcript_candidates_first_existinginplugins/devin/harvest_devin.py. When no database existsyet the Local root stays the reported default, so error messages are unchanged.
A relative
OPENCODE_DBnow resolves below the same selected root.Repro before this patch (both env vars set, db under Roaming) — always picked Local:
2.
minimax_backend: region selection clobbered an explicit base URL (#234)configure_minimax_chatapplied the region default unconditionally and wrote itinto
os.environ["MINIMAX_BASE_URL"]. Sincetrainer.pyandeval_only.pypasscfg.get("minimax_base_url") or None— i.e.Nonewhenever the user did not setit in YAML — configuring
model.minimax_regionsilently discarded a proxy orprivate gateway that the user had set through the environment.
Repro before this patch:
Track whether the current base URL was chosen explicitly and only fill in the
region default when it was not. This makes the code match what the docs already
state (
docs/guide/configuration.md: "an explicitmodel.minimax_base_urlorMINIMAX_BASE_URLoverrides the region default") — previously the docs wereright and the code was wrong. Region selection still works normally when the
base URL is blank or unset.
Tests
Added regression tests covering exactly the scenarios above:
test_default_database_honors_windows_roaming_appdata— APPDATA-only sessiontest_default_database_prefers_the_appdata_root_that_has_the_database— both set, db under Roamingtest_default_database_prefers_local_appdata_when_neither_exists— messaging fallbacktest_relative_opencode_db_resolves_below_the_selected_windows_roottest_env_base_url_survives_a_later_region_selectiontest_explicit_base_url_survives_a_later_region_only_calltest_region_still_applies_when_base_url_is_blankFull suite on this branch: 1114 passed, 10 skipped, 130 subtests passed.
🤖 Generated with Claude Code