Skip to content

fix: allow upstream attribution in translated readmes - #11781

Merged
markijbema merged 1 commit into
mainfrom
mark/allow-translated-readme-opencode-link
Jun 29, 2026
Merged

fix: allow upstream attribution in translated readmes#11781
markijbema merged 1 commit into
mainfrom
mark/allow-translated-readme-opencode-link

Conversation

@markijbema

Copy link
Copy Markdown
Contributor

What

Make the kilocode global-config change-detection baseline (globalStamp) single-owned and seeded eagerly at service construction, in packages/opencode/src/config/config.ts.

Why

globalStamp records the on-disk content of the global config so edits made by other Kilo processes can be detected and hot-reloaded. It had two problems:

  1. Two writers. Both loadGlobal and refreshGlobal wrote globalStamp. A cache reload (loadGlobal) could advance the baseline to whatever was on disk at reload time, silently absorbing an external edit that landed between invalidation and the reload — so the next refreshGlobal would compare against the already-advanced baseline and miss the change.
  2. Empty-string swallow. The baseline started as "" and the guard if (!globalStamp || …) made the very first refreshGlobal a no-op that didn't record anything, leaving detection dependent on whichever writer ran first.

Combined with Server.Default() being memoized once per process (so the Config service closure — globalStamp + cachedGlobal — is shared), this is a latent flake surface: test/kilocode/global-config-refresh.test.ts ("detects external global config edits") intermittently fails on CI with "ask" instead of "allow", even though it passes in isolation. The test and the affected code are identical on main; this is not specific to any feature branch.

Change

  • Seed globalStamp once when the Config service is built.
  • Remove both loadGlobal writes of globalStamp.
  • refreshGlobal is now the sole owner: it advances the baseline only when on-disk content actually differs, then invalidates the cache so the next read reloads.

A wrong initial seed (e.g. service built before the config dir is finalized) is self-correcting: the first refreshGlobal simply triggers one idempotent invalidate+reload — never stale data.

Honesty note

This is a correctness/hardening change for multi-process config-edit detection and it removes the shared-state vector behind the CI flake. I could not write a regression test that fails on the old code and passes on the new one in a single process — the old single-process logic is self-correcting on every reload, and the flake only manifests via shared-closure leakage across the three tests in the file under the full parallel suite. Rather than add a test that passes on both versions (test theater), I left the existing suite as the guard. All 115 config-related tests pass; global-config-refresh.test.ts was run 8× in a loop with no failures.

Testing

  • bun test ./test/kilocode/global-config-refresh.test.ts (8 loops, green)
  • bun test across config/permission/global suites: 115 pass
  • bun run typecheck: clean
  • opencode annotation guard: clean

@markijbema
markijbema marked this pull request as ready for review June 29, 2026 09:09
@markijbema
markijbema enabled auto-merge June 29, 2026 09:09
@kilo-code-bot

kilo-code-bot Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (1 files)
  • script/check-forbidden-strings.ts

Reviewed by gpt-5.4-20260305 · Input: 31.5K · Output: 3.5K · Cached: 179.7K

Review guidance: REVIEW.md from base branch main

@markijbema
markijbema disabled auto-merge June 29, 2026 10:17
@markijbema
markijbema merged commit f90ea35 into main Jun 29, 2026
21 of 25 checks passed
@markijbema
markijbema deleted the mark/allow-translated-readme-opencode-link branch June 29, 2026 10:17
t7tran pushed a commit to t7tran/kilocode that referenced this pull request Aug 14, 2026
…-readme-opencode-link

fix: allow upstream attribution in translated readmes
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