Skip to content

Sync fork with upstream/main (64e90a99) - #5

Merged
doublepi123 merged 22 commits into
mainfrom
sync/upstream-2026-10-17
Oct 16, 2026
Merged

doublepi123 merged 22 commits into
mainfrom
sync/upstream-2026-10-17

Conversation

@doublepi123

@doublepi123 doublepi123 commented Oct 16, 2026 •

Copy link
Copy Markdown
Owner

Merges upstream/main (21 commits, incl. upstream-merged yuga-hashimoto#380/yuga-hashimoto#381/yuga-hashimoto#382/yuga-hashimoto#384/yuga-hashimoto#383/yuga-hashimoto#385). Conflicts resolved to upstream's versions; result differs from upstream/main only in .github/workflows/pr-apk-build.yml.

Pre-PR review

判定: APPROVE

ブロッカー

なし

提案(非ブロッキング)

  • .github/workflows/pr-apk-build.yml — push.branches は main・feat/**・fix/**・ci/** だけで、sync/** が入っていません。そのため今回のような同期ブランチを push しても、debug APK は自動ビルドされません。同期ブランチでも APK が欲しいなら sync/** を追加してください。今回の PR は PR Sync fork with upstream/main (64e90a99) #5 上で android.yml の CI が通っているので、対応は必須ではありません。

チェック済み項目

  • 注意(確認の手段): このセッションでは shell の実行が拒否されたため、ローカルで git diff / git log は実行していません。代わりに、ローカルの .git にある refs・reflog・COMMIT_EDITMSG を読み、GitHub の compare / commits API でコミット ID を指定して比較しました。

  • ブランチの起点(worktree ルール): worktree の reflog を確認しました。HEAD は f4bc87ab(= origin/main)から始まり、その上にマージコミット 96d628e5(親は f4bc87ab と 64e90a99)が 1 つ載っているだけです。origin/sync/upstream-2026-10-17 も 96d628e5 を指しており、upstream/main は 64e90a99 です。

  • upstream/main との差分: upstream/main(64e90a99)...HEAD を比較し、ファイル差分は .github/workflows/pr-apk-build.yml の 1 件だけ(+19/-1)であることを確認しました。PR 説明のとおりです。

  • pr-apk-build.yml がマージで壊れていないか:

    • upstream 側の 21 コミットは .github/ 以下を一切変更していません。
    • origin/main...HEAD の差分にも workflow ファイルは含まれていません。
    • 以上から、fork 専用の CI 変更(push トリガー、inputs.ref、detekt spotlessCheck の事前実行、PR コメント処理の pull_request 限定)は fork main のまま残っています。
  • fork 側の機能・修正が失われていないか: fork の機能コミットと、upstream が取り込んだ対応コミットを、ファイルごとにパッチ比較しました(hunk ヘッダの行番号の違いは除外)。4 組ともすべてのファイルで一致しました。

    • 259ecdd7 ↔ a1e4aeb8(plugin primary agents、7 ファイル)
    • 3b34c1c2 ↔ 625c2595(defaultAgentName、2 ファイル)
    • 6973fe56 ↔ e7c45786(OpenCode V2、27 ファイル)
    • 7d0b10fa ↔ c3eef85b(V1 username 確認、3 ファイル)

    upstream 版を採用しても fork 側の実装が抜け落ちたところはありません。

  • upstream で追加されたレビュー修正: 5a62783e(V2 agent mapping の修正)と 48259771(proxied V1 への到達性、V2 MCP OAuth の制御)は、upstream 版の採用によってマージ結果に入っています。

  • origin/main...HEAD の差分の中身: 差分は upstream の feat(providers): fetch a custom provider's models from <baseURL>/models yuga-hashimoto/and-code#380/fix(providers): preserve existing models during runtime startup yuga-hashimoto/and-code#381/feat: run guest startup commands on local runtime start yuga-hashimoto/and-code#383/feat(chat): show live token speed beside the context meter yuga-hashimoto/and-code#385 で追加されたファイル(custom provider の model 取得、startup commands、token speed、ProtocolDetecting/V2 の追加修正、テスト)と、8 ロケールの strings.xml です。fork 側にしかない変更が上書きされたり削除されたりした形跡はありません。

  • i18n: マージ後のツリーは upstream/main と同一で、upstream で i18n-check を通過済みです。今回のマージで新たに入った差分もないため、改めてキーの照合はしていません。

  • CI: detekt / spotless / lint / unit test / build が PR Sync fork with upstream/main (64e90a99) #5 で通っていることは、依頼者の申告として受け取っており、私自身では確認していません。

doublepi123 and others added 22 commits October 15, 2026 01:30
The custom provider dialog only accepted hand-typed model ids, which is
tedious and error-prone for gateways that proxy dozens of models. Add a
"Fetch models" button that calls the OpenAI-compatible GET /models
endpoint (with an optional API key, falling back to the stored one) and
fills the model field, plus an Edit action so an existing custom
provider's model list can be refreshed without removing it.
- keep parseModelIdList on one line for ktlint function-signature
- rethrow CancellationException so a dismissed fetch cannot touch a
  newly opened dialog
- only fall back to the stored key while editing that provider, so an
  existing id typed in add mode cannot leak its key to a new base URL
- show the localized failure message, with the redacted detail below
The mode chip only listed build/plan, so primaries registered by OpenCode plugins (e.g. oh-my-opencode-slim's orchestrator) were unreachable from the app. List every non-hidden primary/all agent, and default to the agent the server sorts first (its default_agent) instead of hard-coding build.
Implements yuga-hashimoto#379: a workspace can declare guest commands in
.and-code/startup-commands.json and AndCode launches them detached
whenever the local runtime is (re)started. Each entry runs in its own
PRoot instance working in /workspace, so services neither block the
start nor outlive the runtime (the managed-process sweep stops them).
An optional per-entry checkCommand makes startup idempotent: exit 0
skips the command. Best-effort by design - a missing or malformed
config, or a failing entry, never delays or aborts the runtime start.

The PRoot argument list shared by the server launcher, the diagnostic
command runner, and this new runner is extracted into
prootCommandPrefix so the sandbox contract lives in one place.
A whitespace-only checkCommand would probe '/bin/sh -lc ""', which
always exits 0, and silently skip the command it guards. Blank now
means unchecked, with a regression test.
OpenCode 2.x replaced the whole server contract: every route moved under
/api, responses are wrapped in {data}, messages became a typed union, the
event stream was rewritten into lifecycle events and questions became
forms. A V1 client pointed at a V2 server only ever sees the SPA HTML.

Connections now go through ProtocolDetectingOpenCodeApi, which probes
GET /api/info and falls back to the unchanged V1 client when the server
is not V2. The V2 client maps the new shapes onto the existing app DTOs
and OpenCodeEvent stream, so the chat, activity and schedule layers keep
working unmodified:

- sessions/messages walk cursor pages newest-first; archive is emulated
  with session metadata because V2 has no archive field
- prompts apply the chosen agent/model per prompt under a per-session lock
- forms map to question cards (labels answered as option values)
- the event translator keeps part ids aligned with the REST transcript,
  maps execution lifecycle to busy/idle/abort, and keeps long compactions
  alive for stall detection; reconnects reconcile pending permissions,
  forms and running sessions since V2 does not replay events
- message delete and config editing are gated off on V2, where the server
  offers no equivalent

OpenCodeV2LiveTest exercises the backend against a real server and only
runs when OPENCODE_LIVE_URL is set.
The protocol probe authenticated both api/info and the V1 global/health
confirmation as V2's fixed 'opencode' user, so a V1 server running with a
custom OPENCODE_SERVER_USERNAME could no longer be reached. Only api/info
keeps the fixed user now.

LocalOpenCodeBackend.protocol also stops building a delegate: it is read
from Compose on the main thread and building one reads from disk.
OpenCodeAgent has no hidden flag on this base yet, so the V2 client only
maps id, description and mode; the V2 DTO still decodes hidden for when
the flag lands.
Older V1 servers, and V1 builds without an embedded web UI, proxy unknown
paths such as api/info to app.opencode.ai, so that probe can fail with a
5xx or a timeout while the server itself is healthy. Those failures now
still try global/health, and only a 1.x version there is accepted as V1,
so a V2 server's transient errors are never cached as V1.

Also:
- drop V2's hidden internal agents (compaction, title, summary) from the
  agent list
- release a session's prompt lock when the session is deleted
- add an mcpOAuth capability so the MCP screen hides authenticate and
  remove-auth on V2, which has no MCP OAuth endpoints
…p-commands

feat: run guest startup commands on local runtime start
…ustom-provider-models

fix(providers): preserve existing models during runtime startup
…plugin-primary-agents

feat(chat): offer plugin-defined primary agents in the mode picker
…ovider-fetch-models

feat(providers): fetch a custom provider's models from <baseURL>/models
…opencode-v2

feat(opencode): support the OpenCode V2 server API alongside V1
…-display

feat(chat): show live token speed beside the context meter
Conflicts were in the fork's own OpenCode V2 / primary-agent work, which
upstream merged as yuga-hashimoto#382/yuga-hashimoto#384 with further review fixes; take upstream's
versions. The fork keeps only its CI workflow (pr-apk-build.yml).
@doublepi123
doublepi123 merged commit 32ef7f1 into main Oct 16, 2026
5 checks passed
@doublepi123
doublepi123 deleted the sync/upstream-2026-10-17 branch October 16, 2026 17:29
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.

2 participants