feat(shared): add json-cache utility for generic JSON file read/write#1856
Open
iyoda wants to merge 5 commits intocode-yeongyu:devfrom
Open
feat(shared): add json-cache utility for generic JSON file read/write#1856iyoda wants to merge 5 commits intocode-yeongyu:devfrom
iyoda wants to merge 5 commits intocode-yeongyu:devfrom
Conversation
This was referenced Feb 15, 2026
There was a problem hiding this comment.
1 issue found across 37 files
Confidence score: 2/5
- High risk:
package.jsondeclares a self-dependency (oh-my-opencode depends on itself), which is very likely to break installs at runtime. - This is a concrete, user-facing failure path, so merge confidence is low until the circular dependency is removed.
- Pay close attention to
package.json- remove the self-dependency to avoid install failures.
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="package.json">
<violation number="1" location="package.json:65">
P0: Package has a self-dependency (oh-my-opencode depends on itself) which creates a circular dependency. This will cause installation failures.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
package.json
Outdated
| "detect-libc": "^2.0.0", | ||
| "js-yaml": "^4.1.1", | ||
| "jsonc-parser": "^3.3.1", | ||
| "oh-my-opencode": "^3.5.5", |
There was a problem hiding this comment.
P0: Package has a self-dependency (oh-my-opencode depends on itself) which creates a circular dependency. This will cause installation failures.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At package.json, line 65:
<comment>Package has a self-dependency (oh-my-opencode depends on itself) which creates a circular dependency. This will cause installation failures.</comment>
<file context>
@@ -62,6 +62,7 @@
"detect-libc": "^2.0.0",
"js-yaml": "^4.1.1",
"jsonc-parser": "^3.3.1",
+ "oh-my-opencode": "^3.5.5",
"picocolors": "^1.1.1",
"picomatch": "^4.0.2",
</file context>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
60eb995 to
0222f4a
Compare
- Make model-name-matcher.ts the canonical source for fuzzyMatchModel and normalizeModelName - Export normalizeModelName from model-name-matcher.ts (was internal) - Remove duplicate implementations from model-availability.ts - Add re-exports in model-availability.ts for backward compatibility - All existing consumers continue to work via their import paths - Tests pass, typecheck clean, build succeeds
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
0222f4a to
3e976bd
Compare
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
Add a generic
json-cacheutility (readJsonFile/writeJsonFile) that encapsulates the common pattern of reading/writing JSON files with proper error handling and optional directory creation.Changes
src/shared/json-cache.ts(23 lines) —readJsonFile<T>()andwriteJsonFile()src/shared/json-cache.test.ts(223 lines) — 13 comprehensive testsAPI
Verification
bun run typecheck✅bun test✅ (2693 pass, 0 fail)bun run build✅PR Stack
This is PR 5 of 9 in the code deduplication refactor series. Depends on #1855. This PR adds the utility; the next PR (6) applies it to existing consumers.
Summary by cubic
Adds a shared json-cache utility to safely read/write JSON files with optional directory creation, and consolidates duplicate helpers while deleting dead background-task modules. This standardizes common behavior and trims unused code.
Written for commit 3e976bd. Summary will update on new commits.