Repository navigation
fix(opencode): decode agents whose hidden flag is null - #388
Merged
yuga-hashimoto merged 3 commits intoOct 18, 2026
Merged
yuga-hashimoto merged 3 commits into
yuga-hashimoto merged 3 commits into
Conversation
With oh-my-opencode-slim installed, OpenCode's GET /agent reports the plugin agents (orchestrator, fixer, explorer, ...) with "hidden": null. OpenCodeAgent.hidden was a non-null Boolean, so kotlinx.serialization rejected the whole list, the catalogue fell back to no agents, and the mode chip opened an empty menu - tapping "build" appeared to do nothing. Make hidden nullable (V1 and V2 DTOs) and treat only true as hidden. Verified against a live OpenCode 1.19.3 server with the plugin enabled.
This was referenced Oct 18, 2026
Demonic1594
pushed a commit
to Demonic1594/and-code
that referenced
this pull request
Oct 19, 2026
Termux dropped proot 5.1.107.96 from packages.termux.dev (404 on every mirror it was on; grimler.se answers with a body that does not match the pinned SHA-256). A CI run that misses the generated-runtime cache then fails in :app:prepareOpenCodeRuntimeAssets before any test starts, as the re-run of the yuga-hashimoto#388 merge commit did twice. - Refresh runtime_tools/termux_assets.lock.json with `prepare_android_runtime_assets.py --lock-only`. Only proot changes (5.1.107.96 -> 5.1.107.97, new filename and SHA-256 for arm64-v8a and x86_64); libandroid-shmem and libtalloc are unchanged. - Mirror the matching termux-packages recipe: only TERMUX_PKG_VERSION and TERMUX_PKG_SHA256 differ from the previous one. - Point THIRD_PARTY_NOTICES.md and its offline copy at the 5.1.107.97 source archive and SHA-256. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Xw2ucui6t6dQdyGRrnCbHb
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
With a plugin such as oh-my-opencode-slim installed, OpenCode's
GET /agentreports the plugin agents (orchestrator,fixer,explorer, ...) with"hidden": null.OpenCodeAgent.hiddenwas a non-nullBoolean, so kotlinx.serialization rejected the whole list: the catalogue fell back to no agents and the mode chip opened an empty menu, so tappingbuildappeared to do nothing.hiddenis now nullable on both the V1 (OpenCodeAgent) and V2 (V2Agent) DTOs, and onlytruehides an agent.false,nulland a missing key all stay visible, as before."AndCode"; it now readsR.string.app_name.Testing
./gradlew spotlessCheck detekt :app:testGithubDebugUnitTest --tests '*core.api*'(JDK 17 + SDK 35): passed.OpenCodeAgentSelectionTestdecodes a real-shaped/agentresponse with"hidden": nullthrough the productiondefaultJson; the V2AGENT_LISTfixture now coversfalse,nullandtrue.Pre-PR review
判定: APPROVE
ブロッカー
なし
提案(非ブロッキング)
app/src/main/java/com/yugahashimoto/andcode/ui/components/AndCodeComponents.kt:48に、音声アシスタントのタイトルと同じハードコードtext = "AndCode"がまだ残っています。今回の PR の範囲外ですが、別 PR でstringResource(R.string.app_name)に揃えると一貫します。チェック済み項目
.summary.txtで3コミット(a162a405 / 145b406 / 88b37c8、HEAD = 88b37c8)と5ファイル(+38/−10)を確認しました。.diffは全ハンクを読み、ワークツリーの内容と一致することも確かめています。OpenCodeApiModels.kt:173のhiddenはBoolean = falseからBoolean? = nullに変わりました。selectablePrimaryAgents()(:186)は!it.hiddenからit.hidden != trueに変わっています。その結果、trueは非表示、false・null・キーなしは表示となり、変更前と同じ挙動です。V2 のV2Agent.hidden(OpenCodeV2ApiClient.kt:1570)とfilterNot { it.hidden == true }(:194)も同じ判定です。OpenCodeApiClient.defaultJson(:771-776)にはcoerceInputValuesがありません。このため、非 null の Boolean フィールドにnullが来るとリスト全体のデコードが失敗する、というコミットメッセージの説明はコードと合っています。hiddenを読んでいる本番コードは、rg '\.hidden\b'で調べたところ上の2か所だけでした。OpenCodeAgent(...)を作っている箇所(ClaudeCodeTarget.kt:358、AntigravityTarget.kt:158、CodexModels.kt:39、OpenCodeV2ApiClient.kt:195)は、どれもhiddenを渡していないか名前付き引数なので、コンパイルにも挙動にも影響しません。OpenCodeAgentSelectionTestの新しいテストは、本番と同じdefaultJsonを使い、"hidden":nullと未知キーvariantを含む実際の応答の形で、デコード・primary の絞り込み・デフォルトエージェントを確認しています。assertTrueからassertEquals(true, …)への書き換えは型変更に合わせたものです。assertTrueの import は他で使われていないので、消しても問題ありません。AGENT_LISTは false・null・true の3つを含み、期待値が["build","orchestrator"]に更新されています。app_nameは values / ar / es / fr / ja / pt-rBR / ru / zh-rCN の全8ロケールにあります。AndCodeVoiceSession.kt:520ではすでに同じブロックでstringResourceを使っているので、import を足す必要はありません。行の長さは.editorconfigのmax_line_length = 140に収まっています。