Reach OpenCode Go from the command line

test-key accepts opencode and reports the model count its /models
endpoint offers, ask --provider accepts it and maps --model to its own
setting, doctor reports its key for cleanup on it, and config list
masks the key like the other two.
This commit is contained in:
sudoeren
2026-08-25 21:05:23 +03:00
parent 3c336e7178
commit e6b3fcf48f
3 changed files with 46 additions and 5 deletions
+9
View File
@@ -134,6 +134,8 @@ class Keys(DikteTest):
def test_every_provider_falls_back_to_the_variable_of_its_own_name(self):
with mock.patch.dict(os.environ, {"GROQ_API_KEY": "gsk-env"}):
self.assertEqual(cfg.Config().groq_key(), "gsk-env")
with mock.patch.dict(os.environ, {"OPENCODE_API_KEY": "opencode-env"}):
self.assertEqual(cfg.Config().opencode_key(), "opencode-env")
class TranscribeTarget(DikteTest):
@@ -449,6 +451,13 @@ class Defaults(unittest.TestCase):
def test_the_keys_ship_empty(self):
self.assertEqual(cfg.DEFAULTS["openai_api_key"], "")
self.assertEqual(cfg.DEFAULTS["openrouter_api_key"], "")
self.assertEqual(cfg.DEFAULTS["opencode_api_key"], "")
def test_opencode_ships_on_its_own_endpoint(self):
self.assertEqual(cfg.DEFAULTS["opencode_base_url"],
"https://opencode.ai/zen/go/v1")
self.assertEqual(cfg.DEFAULTS["cleanup_opencode_model"], "deepseek-v4-flash")
self.assertEqual(cfg.DEFAULTS["assistant_opencode_model"], "deepseek-v4-flash")
def test_every_language_specific_prompt_has_both_languages(self):
for name in ("CLEANUP_PROMPT", "FILE_CLEANUP_PROMPT", "MEETING_PROMPT",