* refactor(opencode): migrate ModelCache and Config to effect-native services
Remove legacy async wrapper functions from Config module and convert
ModelCache from a stateful namespace with module-level Maps into a
proper Effect service with Context/Layer semantics.
Key changes:
- Delete Config's `makeRuntime`-based async wrappers (get, getGlobal,
update, warnings, etc.) — all callsites now use
`Config.Service.use(...)` through AppRuntime
- Rewrite ModelCache as an Effect service with HttpClient dependency
injection, replacing imperative Map-based caching with Effect-native
Ref cells and TTL logic
- Convert KiloSessions.init and KilocodeBootstrap.init into proper
Effect services with Layer-based dependency injection
- Wire ModelCache.Service into AppLayer, ProviderAuth, ModelsDev, and
HTTP API handler layers
- Update Permission.layer to depend on Config.Service directly instead
of calling Config async wrappers
- Add new test files for KiloSessions and ModelCache Effect integration
- Remove stale Config.get spyOn mocks from tests that no longer need
them (experimental-session-list, recall)
- Fix indexing-auth to use typed IndexingConfig parameter instead of
untyped record access
* fix(model-cache): resolve race conditions in concurrent fetch and cache invalidation
Introduce versioned cache cells with proper key derivation to prevent
stale responses from overwriting fresher data during concurrent fetches.
- Add version tracking to detect and discard outdated fetch results
- Derive cache keys from provider-specific options (baseURL, token, apiKey)
to isolate concurrent requests with different credentials
- Make ModelCache.clear async to properly await invalidation across layers
- Update OrganizationDeps.clear signature to allow Promise<void> return
- Add concurrency and ordering tests for fetch/refresh race scenarios
- Rename local variable from `state` to `entry` in kilo-sessions sync loop
* chore(opencode): remove duplicate imports and fix test layer composition
Remove duplicate `AppRuntime` imports introduced during merge and update
kilo-sessions tests to use Effect-native Auth service instead of static
module calls.
- Remove duplicate `AppRuntime` import in index.ts and instance.ts
- Add Auth.defaultLayer to test layer helper
- Refactor test to yield Auth.Service and use instance methods
- Reorder Effect.provide/Effect.ensuring for correct resource cleanup
* style(opencode): normalize kilocode_change marker comments to block format
Standardize inline `// kilocode_change` annotations across source and
test files to use consistent `// kilocode_change start` / `// kilocode_change end`
block delimiters, improving readability and grep-ability of custom
modifications.
Fixes 257 typecheck errors surfaced after the upstream merge:
- Update imports to new module paths after upstream PR #24554 removed
module barrel files (@/config, @/session, @/util, etc.) and PR #24309
renamed @opencode-ai/shared to @opencode-ai/core.
- Migrate loadMode to use Info.zod.safeParse for consistency with
loadAgents and ConfigCommand (unblocks KilocodeConfig.handleInvalid).
- Drop removed Npm.outdated mock from tests.
- Add missing Config.defaultLayer to bash-permission-metadata test runtime.
- Fix Tips component signature (kilocode drops upstream's 'connected' prop).
- Fix toast.tsx undefined 'duration' reference (should be toastOptions.duration).
- Move filesystem-containment test from deleted shared package to core.
The cross-spawn-spawner module has been moved from src/effect/ to src/
to simplify the core package structure. The src/types.d.ts file which
contained unused type declarations has also been removed. All imports
throughout the codebase have been updated to reflect the new location.
This change reduces the package's internal complexity by flattening the
module hierarchy and removing dead code, making future maintenance easier.
Moved the cross-spawn-spawner module from packages/opencode to packages/core
to enable code sharing across the monorepo. This consolidates the process
spawning infrastructure into the core package so other packages can use
cross-platform child process spawning without duplicating the implementation.
Updated all import statements across the codebase to reference the new
location (@opencode-ai/core/effect/cross-spawn-spawner). Removed the
local copy from the opencode package along with its tests.
Migrate all deep import paths across source and test files to
reference barrel index modules instead of direct file paths. This
covers config, provider, storage, util, tool, lsp, project, and
installation modules. Also moves provider promise helpers out of the
namespace block, switches Clipboard to namespace import style, fixes a
duplicate Filesystem import, removes the deleted paste-summary test,
and corrects snapshot cache typing and indentation.
- Rename PermissionNext → Permission across all remaining src/test files
(drain.ts, routes.ts, remote-sender.ts, task.ts, and 5 test files)
- Fix Effect Layer type resolution for makeRunPromise by accepting
Layer<I, E, any> (Effect 4.x beta type inference limitation)
- Add missing imports: Bus/BusEvent in server.ts, useToast in sync.tsx
- Fix OPENCODE_ → KILO_ flag renames missed by merge transforms
(DISABLE_EXTERNAL_SKILLS in skill/index.ts)
- Fix isCodex → isOpenaiOauth rename in session/llm.ts
- Fix PasteEvent.bytes decoding (decodePasteBytes removed from @opentui/core)
- Fix ProviderID branded type indexing with ProviderID.kilo
- Remove redundant windowsHide from pr.ts (handled by Process.spawn)
- Update Skill import paths after skill.ts → index.ts rename
- Restore Skill.remove and Skill.BUILTIN_LOCATION lost during merge
* feat(vscode): track session status for busy-session warnings
* feat(vscode): warn before saving settings when sessions are running
* feat(vscode): add draft state and save/discard to config context
* feat(vscode): Save button on Settings panel
* fix(vscode): pass remove permission commands correctly to backend
* feat(vscode): handle permission removals
* fix(vscode): detect other sessions in settings panel
* feat(vscode): translations
* feat(vscode): refresh config state on auto-approve tab
* fix(vscode): formatting and unit tests
* fix: reset Config.state cache on no-dispose config write
* fix(vscode): Detect sessions opened before Settings tab is opened
* fix(vscode): Removed previous fix changes
* fix: renamed pattern arrays used for permission rules
* fix: rename savePatternRules to saveAlwaysRules
* feat: generate hierarchical always patterns in bash tool
* feat: validate saveAlwaysRules against always array only
* feat: pass always field through extension bridge to webview
* feat: show hierarchical always patterns in PermissionDock dropdown
* fix: rename pattern to rule in PermissionDock translations, styles, and data-slots
* fix(vscode): correct auto-run comment in PermissionDock
* feat(kilo-vscode): strip trailing wildcard from permission rule labels
* fix: deduplicate permission rules and strip wildcards from display labels
* refactor: move hierarchy to metadata.rules, restore always to arity prefix
* feat: pass always field to permission dock for non-bash tool rules
* fix: correct bash test assertion to check metadata.rules and fix indentation
* fix: hide permission rules dropdown for non-bash tools
* fix: align always-rules route descriptions, whitespace, and restore multi-command tests