Repository navigation
Conversation
Contributor
|
The following comment was made by an LLM, it may be inaccurate: |
read() collapsed a missing file and a file it could not decode into the same
{} result. Every mutating path writes back { ...read(), changed }, so a config
that failed to decode was treated as no configuration and immediately
overwritten with only the field being changed, discarding the stored password,
hostname, cors and env with no warning and exit code 0.
Only an absent file reads as empty now; one that exists but cannot be decoded
fails with the path so the command reports it instead of rewriting it.
feiiiiii5
force-pushed
the
svc-config-read
branch
from
October 15, 2026 01:37
6a3ca00 to
f950055
Compare
3 tasks done
Contributor
|
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
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.
Issue for this PR
Fixes #52412
Type of change
What does this PR do?
ServiceConfig.readreturned{}for both a missing file and one it could not decode. Every mutating path writes back{ ...read(), changed }, so a config that failed to decode was treated as empty and immediately overwritten with just the field being changed, dropping the storedpassword,hostname,port,corsandenv— exit code 0, no warning.Only an absent file reads as empty now. A file that exists but neither decoder accepts fails with its path, so the command reports it instead of rewriting it.
This sits after the legacy-config repair that has since landed on
dev: a filedecodeLegacyunderstands is still repaired in place and returned, exactly as before. Only the silentreturn {} as Infoat the end of that chain is replaced, so the new failure channel does not take the repair path with it.How did you verify your code works?
Rebased onto
328f74c21and re-run:bun test test/service-config.test.tsinpackages/cli— with the one-line change reverted, 1 pass / 2 fail:service setexits successfully against a torn write ({"hostname":"127.0.0.1","password":"user-secr) and the stored settings are clobbered. With the change, 3 pass / 0 fail, including that a missing config still reads as empty.bun run typecheckinpackages/cli: clean.bun run checkfrom the repo root (lint + workspace typecheck): 32/32 tasks.cors.test.tsin the same package already pins that a failedsetmust leave the stored config alone.Screenshots / recordings
Not a UI change.
Checklist