From 55ede19e0d62505ab79302cf1c2dd79781978f5e Mon Sep 17 00:00:00 2001 From: Mark IJbema Date: Mon, 25 May 2026 10:38:05 +0200 Subject: [PATCH] Revert "review: OpenCode v1.14.41 upstream merge review (PR #10507)" --- BROKEN_PIPELINE_CHAINS.md | 102 ------------------------------------- INFRASTRUCTURE_CHANGE.md | 42 --------------- KILOCODE_CHANGE_MARKERS.md | 63 ----------------------- OPENCODE_MENTIONS.md | 45 ---------------- TESTS.md | 54 -------------------- UNNECESSARY_MARKERS.md | 50 ------------------ 6 files changed, 356 deletions(-) delete mode 100644 BROKEN_PIPELINE_CHAINS.md delete mode 100644 INFRASTRUCTURE_CHANGE.md delete mode 100644 KILOCODE_CHANGE_MARKERS.md delete mode 100644 OPENCODE_MENTIONS.md delete mode 100644 TESTS.md delete mode 100644 UNNECESSARY_MARKERS.md diff --git a/BROKEN_PIPELINE_CHAINS.md b/BROKEN_PIPELINE_CHAINS.md deleted file mode 100644 index dff23be3a06..00000000000 --- a/BROKEN_PIPELINE_CHAINS.md +++ /dev/null @@ -1,102 +0,0 @@ -# Broken Pipeline Chains Review — PR #10507 (OpenCode v1.14.41) - -## Methodology - -1. Pulled the full PR diff (`gh pr diff 10507 --repo Kilo-Org/kilocode`, 14k lines). -2. Located every `kilocode_change` marker in the diff (~80 hits across ~30 files) and the surrounding upstream context. -3. For each Kilo-touched chain, walked upstream → downstream: - - producers / setters / event emitters - - intermediate routers, schemas, projectors, sync stores - - downstream consumers (UI props, projectors, handlers, tests). -4. Cross-checked the post-merge tree (`grep` of `packages/opencode/src` and `packages/kilo-vscode/src`) for stale references to symbols/events/types renamed by upstream. - -Focus areas: workspace warp/restore rename, SyncEvent ownerID system, ACP `defaultModel` chain, `Session.get` error-channel migration, `Modelv2.Ref` payload migration in `SessionEvent.ModelSwitched`, TUI sync-v2 ordering flip, prompt/index `lastUserMessage` chain, ACP session cleanup, and kilocode_change marker integrity. - -## Findings - -Each finding is rated as **Confirmed broken**, **Likely broken**, or **Worth verifying** (default when in doubt). - -### 1. Worth verifying — `SyncEvent.claim()` ownerID never reaches the remote `/sync/replay` handler - -- `packages/opencode/src/control-plane/workspace.ts:622` calls `SyncEvent.claim(input.sessionID, input.workspaceID ?? Instance.project.id)` during a session warp. After this call, `sync/index.ts:91-93` rejects any subsequent `replay`/`replayAll` whose `options.ownerID` does not equal the claimed owner. -- The remote endpoints invoked during warp (`packages/opencode/src/server/routes/instance/httpapi/handlers/sync.ts:50` and the legacy Hono route `packages/opencode/src/server/routes/instance/sync.ts:103`) call `sync.replayAll(events)` / `SyncEvent.use.replayAll(events)` with **no `ownerID`** option. -- This is the new upstream "session steal" mechanism and ours is unchanged from upstream, but since Kilo TUI/Agent Manager users may exercise warp differently than the upstream desktop app (e.g. local-only workspaces), confirm that: - - The local-only warp path that calls `SyncEvent.claim` then later replays locally still functions — local replay also goes through `replay()` / `replayAll()` without ownerID. - - The bookkeeping in our worktree-based Agent Manager flows still work after a session warp, because subsequent local emissions of session events for the same `sessionID` will be **silently dropped** unless the caller threads `ownerID`. -- Although mainly an upstream concern, confirm Kilo CLI flows (e.g. `kilo run` re-using sessions across worktrees) do not regress. - -### 2. Worth verifying — `Session.get` now returns `Effect.Effect` (was throwing as defect) - -- `packages/opencode/src/session/session.ts:7882` returns `Effect.fail(new NotFoundError(...))` instead of `throw new NotFoundError(...)`. The `Interface` types now expose `NotFound` in the error channel for `get`, `fork`, and `remove`. -- All upstream callers in `session/prompt.ts`, `session/revert.ts` were updated with `.pipe(Effect.orDie)` to preserve old behavior. -- However `packages/opencode/src/tool/task.ts:70` still does `const parent = yield* sessions.get(ctx.sessionID)` **without `Effect.orDie`**, so the tool's effect now carries a `NotFound` error in its type. This is upstream code (no kilocode_change) but is part of the Kilo task tool runtime — confirm `bun run typecheck` is green, and that any Kilo callers of `tool/task.ts` don't rely on `NotFound` being a defect. -- Kilo wrappers (`packages/opencode/src/kilocode/permission/allow-everything.ts`, `kilo-sessions/*`, `tool/recall.ts`, `kilocode/plan-followup.ts`) all use the **promise** facade `Session.get(...).catch(...)`, which is unchanged — no impact at runtime, but verify the storage `NotFoundError` continues to be the same class as the new schema-tagged variant referenced in `cli/cmd/tui/component/dialog-session-list.tsx` etc. - -### 3. Worth verifying — `SessionEvent.ModelSwitched` payload shape change - -- The schema flipped from flat `{ id, providerID, variant }` to nested `{ model: Modelv2.Ref }` (`packages/opencode/src/v2/session-event.ts:50`). All in-tree producers (`session/prompt.ts:1022`, `session/processor.ts:511`, `v2/session.ts:279`) and consumers (`session/projectors-next.ts:152`, `v2/session-message-updater.ts:108`, `v2/session-message.ts:26`) were updated. -- However `Modelv2.VariantID.make(input.variant ?? "default")` is now used unconditionally — if any historical persisted `assistant.variant` round-trips through `processor.ts` with a value that does not parse as a `VariantID` brand, it could throw. Since the brand has no validator (just `Schema.brand`) this should be safe, but worth a unit test pass on `bun test ./test/v2/session-message-updater.test.ts`. -- Tests in `test/v2/session-message-updater.test.ts:11842` and `test/tool/task.test.ts` now construct `Modelv2.ID.make/ProviderID.make/VariantID.make` — confirm Kilo-only test fixtures (under `test/kilocode/`) do not still build `ModelSwitched` payloads in the old flat shape. (Quick grep showed none.) - -### 4. Worth verifying — TUI `sync-v2` newest-first ordering invalidates downstream `findLast`/reverse logic - -- `packages/opencode/src/cli/cmd/tui/context/sync-v2.tsx` was switched from `push` + `findLastIndex` → `unshift` + `findIndex`, i.e. `sync.data.messages[sessionID]` is now stored newest-first. -- The Kilo-specific block at `packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx:373-400` (sync local agent/model on newest user msg) reads `sync.data.message[sessionID]` (singular `message`, the v1 store) — it is **not** affected. -- However the non-Kilo block `feature-plugins/system/session-v2.tsx:43` does `messages().toReversed()` which used to convert "oldest-first" → "newest-first"; with the new unshift behavior `toReversed()` now produces oldest-first ordering. Confirm this was an intentional upstream UI change and that Kilo-specific subagent footers / sidebar / dialogs that inspect `sync.data.messages` still work. - -### 5. Worth verifying — workspace `extra` made optional, but `CreateInput.extra` defaults to `null` - -- `packages/opencode/src/control-plane/workspace.ts:5202` made `CreateInput.extra` `Schema.optional`, and the create call now spreads `{ ...input, extra: input.extra ?? null }`. Confirm Kilo adapters (any `kilocode/control-plane/...` or VSCode Agent Manager backend) don't pass undefined when null is required, and that consumers of `WorkspaceInfo.extra` still tolerate null vs. their previous default. - -### 6. Worth verifying — ACP `defaultModel` no longer throws "no providers configured" message - -- `packages/opencode/src/acp/agent.ts:1727` previously threw `"no model available: no providers are configured and no default model is set"`; upstream replaced it with the generic `"No models available"`. The Kilo error-handling path that surfaces this to users (toast / VSCode webview) may rely on the original wording. Search for callers that match against the old string before promoting this PR. - -### 7. Worth verifying — `dialog-workspace-create` API rename (`restoreWorkspaceSession` / `openWorkspaceSession` / `DialogWorkspaceCreate` → `warpWorkspaceSession` / `openWorkspaceSelect` / `DialogWorkspaceSelect`) - -- All in-tree call sites were renamed (`dialog-session-list.tsx`, `prompt/index.tsx`). A repo-wide grep for the old names returns zero hits in source, but confirm: - - Any Kilo-only commands/agents (`.kilo/command/*.md`) or webview UI that historically referenced the old slash command (e.g. `/restore`) now use `/warp`. Slash is now `slash: { name: "warp" }` (`prompt/index.tsx:3860`). - - The kilocode_change end markers in `dialog-session-list.tsx` still bracket the right code; the upstream-removed "ctrl+w new workspace" entry was outside the kilocode block, so the surrounding `// kilocode_change end` at `dialog-session-list.tsx:289` correctly closes the renamed/rewired section. - -### 8. Worth verifying — `Workspace.Event.Restore` removed without replacement event - -- The `workspace.restore` BusEvent was deleted entirely (`control-plane/workspace.ts:5193`) along with the `total/step` progress payload. No in-tree subscribers remained, but anything outside this repo (Kilo VS Code extension, JetBrains plugin, Agent Manager UI, telemetry pipeline) that listened to `workspace.restore` via SSE/event API will now silently never see progress updates. Search the cloud / VSCode codebases before merging. - -### 9. Worth verifying — `SessionRestoreInput` / `SessionRestoreHttpError` renamed to `SessionWarpInput` / `SessionWarpHttpError` - -- These error classes are exported from `control-plane/workspace.ts`. No Kilo consumers found in this repo. Confirm `@kilocode/sdk` regeneration and any error-name string comparisons (e.g. `result?.error?.name === "VcsApplyError"` in `dialog-workspace-create.tsx:3293`) are still aligned. - -### 10. Worth verifying — `editorContextHover` / `dismissEditorContext` removed - -- Prompt's hover-to-dismiss editor-context label was replaced with a static label driven by `editor.labelState()` (`packages/opencode/src/cli/cmd/tui/context/editor.ts:380`). The functions `dismissEditorContext` and `editorSelectionKey` (formerly used by the Kilo-touched submit path) are no longer called from `prompt/index.tsx:3960`. No kilocode_change in this area was removed, but confirm any Kilo overrides or stories under `packages/kilo-vscode/webview-ui/` / `packages/kilo-ui/` don't import `dismissEditorContext`. - -### 11. Worth verifying — `processor.ts` step-failed event coerces `error.type` to literal `"unknown"` - -- Upstream tightened `Step.Failed.error` to `UnknownError` (`session-event.ts:8569`) with `type: Schema.Literal("unknown")`. `session/processor.ts:7680` now hardcodes `type: "unknown"`, dropping the prior `error.name`. Any Kilo-side telemetry / analytics that branched on `step.failed.error.type` will lose distinguishability. Spot-check `packages/kilo-telemetry/` and the Suggestion/Question Kilo pipelines. - -### 12. Worth verifying — `task.ts` cost propagation refactor: `Effect.ensuring` placement - -- `packages/opencode/src/tool/task.ts:8064-8081` was changed to `(costBefore, exit) => Effect.gen { if (Exit.hasInterrupts(exit)) yield cancel }.pipe(Effect.ensuring())`. -- The kilocode_change "snapshot child cost" / "propagate subagent cost delta" markers still wrap the right blocks, but the `cancel` effect (formerly synchronous) is now `Effect.Effect`; `ops.cancel` returning `Effect.Effect` is honored. However the new code yields `cancel` only on interrupt — confirm that on **non-interrupt completion** the cancel chain is not still expected to run elsewhere (it isn't called any other way), and that the `(_)` swallowing in test stub `cancel: () => Effect.void` matches the new signature. - -### 13. Worth verifying — `Modelv2.VariantID.make("default")` fallback collides with `availableVariants` filter - -- `packages/opencode/src/acp/agent.ts:formatModelIdWithVariant` (line ~2580 of diff) now picks `variant ?? availableVariants[0]` and `buildConfigOptions` similarly defaults to `DEFAULT_VARIANT_VALUE`. Previously when no variant was selected, the function returned the bare `provider/model` id; now it always appends a variant suffix. Any Kilo-side parser (e.g. `Provider.parseModel`, kilo-gateway) that historically received `provider/model` without trailing `/variant` will now receive a 3-segment id. Verify Kilo's gateway routing (`packages/kilo-gateway/`) tolerates the new format. - -### 14. Worth verifying — `Workspace` layer now requires `Vcs.Service` + `Instance` + `InstanceStore` - -- New imports at `control-plane/workspace.ts:5146-5171`. `defaultLayer` was extended (line ~5697 in diff). Anywhere Kilo code constructs `Workspace.layer` for tests/scripts without the `Vcs.defaultLayer` / `InstanceStore.defaultLayer` / `InstanceBootstrap.defaultLayer` will fail at startup. The test `httpapi-instance-context.test.ts` was updated, but spot-check Kilo-only tests under `test/kilocode/` and any standalone scripts. - -## Summary - -No outright **confirmed broken** chain was found. The upstream merge is mechanically sound — every renamed symbol in shared code has its callers updated in the same patch, and Kilo-specific files (`packages/opencode/src/kilocode/`, `packages/opencode/test/kilocode/`, `packages/kilo-*`) do not reference any of the removed/renamed types. - -The 14 findings above are all places where a chain *could* be regressed by the merge but require a human to verify either: -- a runtime contract (string error matching, slash command names, telemetry event types), -- behavior of out-of-repo consumers (VSCode extension, JetBrains plugin, cloud, telemetry pipeline), -- or pre-existing assumptions in Kilo code that interacted with upstream behavior implicitly. - -Top priorities for a human pass: -1. **Findings 1, 4, 8** — sync ownership / event ordering / removed `workspace.restore` event are most likely to surface as silent failures. -2. **Finding 7** — slash-command rename `/restore` → `/warp` user-visible change. -3. **Findings 11, 13** — telemetry/gateway consumers of `Step.Failed.error.type` and 3-segment model ids. diff --git a/INFRASTRUCTURE_CHANGE.md b/INFRASTRUCTURE_CHANGE.md deleted file mode 100644 index e3008b84b53..00000000000 --- a/INFRASTRUCTURE_CHANGE.md +++ /dev/null @@ -1,42 +0,0 @@ -# Infrastructure Review — PR #10507 (OpenCode v1.14.41 merge) - -No `.github/workflows/`, `.github/actions/`, Docker, release-deploy, issue templates, or changelog automation files are touched. CI/release infrastructure is untouched. Generated SDK regen (`packages/sdk/js/src/v2/gen/*`, `packages/sdk/openapi.json`) follows from upstream API changes — expected, not a concern. - -## Findings - -### 🚩 Accidentally committed Gradle cache (must fix) -The following Gradle local-cache files were added under `packages/kilo-jetbrains/build-tasks/.gradle/` and should never be in version control: - -- `packages/kilo-jetbrains/build-tasks/.gradle/9.4.1/executionHistory/executionHistory.bin` -- `packages/kilo-jetbrains/build-tasks/.gradle/9.4.1/executionHistory/executionHistory.lock` -- `packages/kilo-jetbrains/build-tasks/.gradle/buildOutputCleanup/buildOutputCleanup.lock` -- `packages/kilo-jetbrains/build-tasks/.gradle/buildOutputCleanup/cache.properties` -- `packages/kilo-jetbrains/build-tasks/.gradle/buildOutputCleanup/outputFiles.bin` -- `packages/kilo-jetbrains/build-tasks/.gradle/file-system.probe` - -These are local Gradle build state, not infrastructure we want to ship. They are not from upstream opencode (this is a Kilo-only path). Remove from the PR and ensure `packages/kilo-jetbrains/build-tasks/.gradle/` is in `.gitignore`. - -### `script/publish.ts` — Kilo behavior preserved ✅ -Upstream added `desktop/scripts/finalize-latest-{json,yml}.ts` calls. They were imported as **commented-out** lines wrapped in `// kilocode_change start - Kilo does not ship the opencode desktop app` markers. Correct handling — Kilo's publish flow is preserved and the upstream additions are tracked for future merges. - -### `turbo.json` — additive, OK -Adds `@opencode-ai/ui#test` and `@opencode-ai/ui#test:ci` task definitions. Pure additions to support upstream's new `packages/ui` test scripts. Does not override any Kilo-specific Turbo task. No conflict with our infra. - -### `packages/ui/package.json` — additive scripts -Upstream adds `"test"` and `"test:ci"` scripts to `@opencode-ai/ui`. Matches the `turbo.json` additions. No Kilo override displaced. - -### `packages/kilo-jetbrains/package.json` -Adds `"version": "7.3.5"` and empty `dependencies`/`devDependencies`/`peerDependencies` fields. Kilo-owned package; minor metadata addition, not infra-impacting. - -### `packages/opencode/package.json` -Bumps `@agentclientprotocol/sdk` 0.16.1 → 0.21.0. Standard upstream dep bump, not a CI/release concern. - -### Root `package.json` -Bumps `@types/node` 22.13.9 → 24.12.2. Worth noting because Node 24 typings can surface new lib type errors in shared code, but it does not change workspace/build infrastructure. - -### `.opencode-version` and `bun.lock` -Standard merge artifacts — version bump to `v1.14.41` and corresponding lockfile updates. Expected. - -## Summary - -The only real concern is the accidentally committed Gradle cache directory under `packages/kilo-jetbrains/build-tasks/.gradle/` — those files must be removed before merging and the path added to `.gitignore`. All other infrastructure-touching changes are either upstream-additive (no override of Kilo-specific automation) or properly gated behind `kilocode_change` markers (`script/publish.ts`). No upstream CI/CD, release flow, or repo automation is being adopted in a way that displaces ours. diff --git a/KILOCODE_CHANGE_MARKERS.md b/KILOCODE_CHANGE_MARKERS.md deleted file mode 100644 index 8a3ed503d50..00000000000 --- a/KILOCODE_CHANGE_MARKERS.md +++ /dev/null @@ -1,63 +0,0 @@ -# `kilocode_change` Marker Audit — PR #10507 (OpenCode v1.14.41 merge) - -## Methodology - -1. Pulled the PR file list and full diff via `gh pr diff 10507 --repo Kilo-Org/kilocode`. -2. Counted **133 changed files** in the PR. -3. Searched the diff for any line beginning with `-` (i.e. removed) that contains the string `kilocode_change` to find every removed marker. -4. For each removal, inspected surrounding context to determine whether: - - the marker was preserved on a corresponding `+` line (rewording / reformatting), - - the marker was moved (block boundaries shifted to enclose only the original Kilo content), - - the marker plus its underlying code was deleted intentionally, or - - the marker was dropped accidentally (orphaned start/end, lost annotation). -5. Cross-checked any suspicious cases against the current state of the file in the working tree. - -The vast majority of `kilocode_change` removals in the diff are benign: they are paired with re-added `+` markers (e.g. enriched comments, single-line collapses of start/end blocks, marker-position shifts to keep new upstream code outside the Kilo block). Below are the only cases that need attention. - -## Findings - -### 🟥 1. Orphaned `kilocode_change start` in `local.tsx` (likely accidental) - -**File:** `packages/opencode/src/cli/cmd/tui/context/local.tsx` - -Two markers were removed around the trailing `createEffect(...)` (PR diff lines 4402 and 4416): - -- `// kilocode_change - validate configured agent model when agent changes` (single-line outer annotation, line 4402 of the diff) -- `// kilocode_change end` (line 4416 of the diff) - -The inner `// kilocode_change start - configured models resolve directly without persistence` at line 468 of the new file **was kept**, but its matching `end` is gone. Verified with: - -``` -grep -c "kilocode_change start" packages/opencode/src/cli/cmd/tui/context/local.tsx → 8 -grep -c "kilocode_change end" packages/opencode/src/cli/cmd/tui/context/local.tsx → 7 -``` - -The Kilo `createEffect` block (which warns about an invalid configured model and is not present in upstream) is now an unclosed Kilo block. Either: - -- restore the trailing `// kilocode_change end` after the closing `})` on line 478, or -- demote the marker to a single-line `// kilocode_change` on the `createEffect(() => {` line. - -This is the only marker imbalance introduced by the PR and almost certainly an accidental drop during conflict resolution. - -### 🟨 2. Deletion of Kilo-only test file `workspace-restore.test.ts` (verify intent) - -**File:** `packages/opencode/test/workspace/workspace-restore.test.ts` (deleted) - -The whole file was removed. It was a Kilo-specific test fixture annotated with: - -> `// kilocode_change - skip these tests after upstream's Workspace refactor.` - -The test was already `describe.skip(...)` and the comment explained that its fixtures relied on `spyOn(globalThis, "fetch")` / `SyncEvent.replayAll` patterns that upstream had refactored away. Removing the file is consistent with that note (it was effectively dead code awaiting a rewrite), but because this is a Kilo-only test rather than upstream code, it is worth a quick human confirmation that the follow-up tracked in the comment is being abandoned (or moved elsewhere) rather than silently dropped. - -## Other removals reviewed and cleared - -All remaining `-`-side `kilocode_change` lines in the diff are paired with `+`-side replacements that preserve the marker's intent. Notable benign cases: - -- `provider-error.tsx`: title/description markers re-added on the new lines (PR lines 2853–2858). -- `config.ts`: `// kilocode_change start` enriched with explanatory tail text (PR line 2531). -- `session/processor.tsx`: paired `start`/`end` collapsed into a single inline `// kilocode_change - !part.ignored…` on the same statement (PR lines 7601–7604). -- `provider-transform.test.ts`: `// kilocode_change end` moved earlier in the file so newly added upstream tests are correctly outside the Kilo block (PR lines 10275 vs 10356). -- `auth.test.ts`: trailing `// kilocode_change` lifted from the `test(...)` line onto its own line (PR lines 10368–10370). -- `agent.test.ts`: `start`/`end` block boundaries reshuffled around the `arrayContaining` block, plus single-line markers on `task: false` and `openTelemetry: true` re-added verbatim (PR lines 11703–11808). - -No other shared opencode files lost a `kilocode_change` annotation in this PR. diff --git a/OPENCODE_MENTIONS.md b/OPENCODE_MENTIONS.md deleted file mode 100644 index be1d549bb67..00000000000 --- a/OPENCODE_MENTIONS.md +++ /dev/null @@ -1,45 +0,0 @@ -# User-facing OpenCode mentions in PR #10507 - -Scope: lines added by the upstream-merge PR (`gh pr diff 10507` filtered to `^+` for `opencode` / `anomalyco`). Most hits are file paths under `packages/opencode/` or internal symbol/package names (`@opencode-ai/core`, `@opencode/v2/Auth`, OAUTH_DUMMY_KEY = `"opencode-oauth-dummy-key"`, schema names) — none of those reach end users. - -The notable user-facing items below are all introduced by the new "custom provider" flow upstream added to the TUI provider dialog. - -## TUI strings rendered to users - -File: `packages/opencode/src/cli/cmd/tui/component/dialog-provider.tsx` - -1. Line 89 — prompt description (shown when user picks "Other" provider): - > "This only stores a credential. Configure the provider in opencode.json to use it." - -2. Line ~382 — toast after saving an unknown provider credential: - > "Saved credential for ${providerID}. Configure it in opencode.json to use it." - - Kilo's primary config file is `kilo.json` / `kilo.jsonc` (with `opencode.json` accepted as a fallback per `config.ts:422`). The user-visible reference to `opencode.json` is upstream wording. - -3. Lines 51-56 — hardcoded provider description map embedded in the shared upstream file: - ```ts - description: { - opencode: "(Recommended)", - anthropic: "(API key)", - openai: "(ChatGPT Plus/Pro or API key)", - "opencode-go": "Low cost subscription for everyone", - }[provider.id], - ``` - Kilo already overrides `PROVIDER_PRIORITY` (and has its own `PROVIDER_DESCRIPTIONS` in `src/kilocode/cli/cmd/tui/component/dialog-provider.tsx`), but the upstream description map remains the one actually consulted by `providerOptions()`. The `opencode` / `opencode-go` entries would only render if a provider with those IDs is present in `sync.data.provider_next.all`, which is not the case for stock Kilo today — but the strings are now baked into shared TUI code. - -## Non-user-facing OpenCode references (informational, not problems) - -- Internal package / module / schema names: `@opencode-ai/core/*`, `@opencode-ai/ui#test` (turbo task), `@opencode/v2/Auth`, `@opencode/v2/Model`, `OAUTH_DUMMY_KEY = "opencode-oauth-dummy-key"`, schema literal `opencode: schema.make("opencode")`. -- Remote-config URL convention: `${url}/.well-known/opencode` in `src/config/config.ts:5058+` — external endpoint contract, the existing `kilocode_change` marker is preserved. -- Dev-only files: `notes/thoughts/...` plugin-design notes, `specs/effect/errors.md`, test fixtures (`test@opencode.test`, `app.opencode.ai` CORS test, `opencode#24432` regression comment, `.opencode/tool/emoji.ts` mock path). -- Build/publish comment: `// kilocode_change start - Kilo does not ship the opencode desktop app` in `script/publish.ts`. -- `.opencode-version` file used by the merge tooling. - -## No matches found for - -- Links to `opencode.ai` / `github.com/opencode-ai` / `github.com/anomalyco` in any user-facing surface (the only `opencode.ai` reference is inside a CORS unit test). -- Changes to `package.json` `name` / `description` / `displayName` / READMEs that surface "opencode" to users. - -## Summary - -Two genuine user-facing OpenCode mentions were added by the merge, both in the new TUI custom-provider flow (`dialog-provider.tsx` lines 89 and ~382), instructing users to "Configure the provider in opencode.json". A third location (hardcoded provider description map referencing `opencode` / `opencode-go`) is dormant under Kilo's current provider list but is now embedded in shared code. Everything else flagged is internal (package names, file paths, test fixtures, dev notes, build comments). diff --git a/TESTS.md b/TESTS.md deleted file mode 100644 index ca2870edae0..00000000000 --- a/TESTS.md +++ /dev/null @@ -1,54 +0,0 @@ -# PR #10507 — Kilo-Specific Test Removal Check - -## Summary - -**No Kilo-specific tests were removed.** All ~110 Kilo-owned test files under `packages/opencode/test/kilocode/` and other Kilo paths are preserved. - -## Kilo-Specific Test Files Touched in PR - -### `packages/opencode/test/kilocode/` - -Both files modified — content preserved, only the `cancel` stub signature was updated to match a Kilo-side type change (`TaskPromptOps.cancel` now returns an `Effect`): - -- `test/kilocode/task-nesting.test.ts` — single-line tweak: `cancel() {}` → `cancel: () => Effect.void` -- `test/kilocode/tool-task-model.test.ts` — same single-line tweak - -No assertions removed, no test cases dropped. - -### `packages/opencode/test/server/auth.test.ts` - -`kilocode_change` marker preserved. The test `"defaults to the kilo username"` is intact — the comment was just moved from a trailing position to its own line. - -### `packages/kilo-ui/src/components/reasoning-heading.test.ts` - -Formatting-only change (line break for prettier). Test logic untouched. - -## Deleted Test Files - -One test file was deleted in the diff: - -- `packages/opencode/test/workspace/workspace-restore.test.ts` — **upstream-originated** test (added by upstream PR #22837, "fix: add a few more tests for sync and session restore"). It was already marked `describe.skip(...)` on the Kilo side with a `kilocode_change` comment explaining the upstream `Workspace` refactor broke the spy-based fixtures. Upstream removed it entirely in this version; we are inheriting that deletion. Not a Kilo-specific test. - -No files under `test/kilocode/` were deleted, and no other test files were deleted. - -## Test Run - -Root `bun install` fails due to a native build (`tree-sitter-powershell` needs `make`, missing in this sandbox). Worked around with `bun install --ignore-scripts`. The full `bun test` suite cannot reasonably finish in the available time window in this environment (>3 min and counting), but the two Kilo-specific tests modified in this PR were run directly and pass: - -``` -$ bun test test/kilocode/task-nesting.test.ts - 2 pass - 0 fail - 7 expect() calls -Ran 2 tests across 1 file. [8.89s] - -$ bun test test/kilocode/tool-task-model.test.ts - 8 pass - 0 fail - 32 expect() calls -Ran 8 tests across 1 file. [12.02s] -``` - -## Conclusion - -The PR makes only mechanical adjustments to Kilo-owned tests (signature update to match an `Effect`-returning `cancel`, plus a comment reflow). The single deleted test file (`workspace-restore.test.ts`) is upstream-originated, not Kilo-specific, and had already been skipped on our side. The Kilo test suite remains intact. diff --git a/UNNECESSARY_MARKERS.md b/UNNECESSARY_MARKERS.md deleted file mode 100644 index 3b430ef5dc1..00000000000 --- a/UNNECESSARY_MARKERS.md +++ /dev/null @@ -1,50 +0,0 @@ -# Unnecessary `kilocode_change` Markers — PR #10507 (v1.14.41) - -Last merged upstream: **v1.14.41** (`8ba2a917`) -Mode: dry-run, no writes performed. - -## Findings - -One file carries `kilocode_change` markers but is otherwise identical to *transformed* upstream — the marker is redundant because the rewrite is handled automatically by `script/upstream/transforms/transform-extensions.ts` (which converts `anomalyco/opencode` → `Kilo-Org/kilocode`). - -| Bucket | File | Notes | -|---|---|---| -| markers-only | `packages/opencode/src/cli/cmd/tui/component/error-component.tsx` | Line 34 marks the bug-report URL rewrite, but the URL is auto-transformed during upstream merges, so the marker has no real diff behind it. Touched in this PR by commit `3185e8d58` (rebrand upstream attribution and bug-report URLs). | - -`reset-to-upstream.ts --dry-run` confirms it would safely reset: - -``` -[INFO] [DRY-RUN] Would reset packages/opencode/src/cli/cmd/tui/component/error-component.tsx to transformed upstream v1.14.41 -``` - -## `find-reset-candidates.ts --dry-run` — Summary - -``` -- Last merged upstream: v1.14.41 (8ba2a917) -- Scope: (all shared paths) -- Review limit: 5 non-marker diff line(s) -- Mode: dry-run (no writes) -- Total candidates: 692 -- Non-code assets skipped: 324 -- Config-protected files skipped: 1523 - -| Bucket | Count | Action | -|-------------------|-------|----------------| -| markers-only | 1 | would reset | -| cosmetic-only | 1 | would reset | -| small-diff | 141 | would reset | -| large-diff | 269 | skipped | -| identical | 118 | nothing to do | -| upstream-missing | 159 | skipped | -| local-missing | 3 | skipped | -| non-code-asset | 324 | skipped | -| config-protected | 1523 | skipped | -``` - -`cosmetic-only`: `packages/opencode/src/session/prompt/anthropic.txt` — whitespace-only drift, not marker-related. - -`small-diff` (141 files) contains real diffs (markers + ≤5 non-marker lines); not strictly "marker-only" candidates and out of scope for this audit. - -## Recommendation - -Drop the `// kilocode_change` marker on `error-component.tsx:34` (or run `reset-to-upstream.ts` against the file) — the transform pipeline already rewrites the URL on every merge, so the marker is misleading.