Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: format code
  • Loading branch information
actions-user committed Nov 11, 2025
commit 6776422eed8d797a596b6d3a6c8b17caf6e905b4
14 changes: 6 additions & 8 deletions packages/opencode/src/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -776,14 +776,12 @@ export namespace Config {

export async function update(config: Info) {
let filepath = path.join(Instance.directory, "opencode.json")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So something I was thinking is that the config.ts state should track all the files it loaded configs for and it wouldn't be that useful in most places but it would allow opencode debug config to have some mode where we state where every file came from and what it had to help users debug

maybe if we had that we wouldn't need to do a file system search each time and then we could also use it to power the config debug command later

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I think I know the perfect solution for this. I think I'll have an update later today.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rekram1-node I did some fiddling around. Turns out the idea I had in mind might involve a pretty significant refactor. Therefore it's probably best to leave this to you.

for (
const file of [
"opencode.json",
"opencode.jsonc",
path.join(".opencode", "opencode.json"),
path.join(".opencode", "opencode.jsonc"),
]
) {
for (const file of [
"opencode.json",
"opencode.jsonc",
path.join(".opencode", "opencode.json"),
path.join(".opencode", "opencode.jsonc"),
]) {
const fullPath = path.join(Instance.directory, file)
if (await Bun.file(fullPath).exists()) {
filepath = fullPath
Expand Down
Loading