fix: preserve array config entries on save#92
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 19a94734d0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const restByPath = new Map<string, number>(); | ||
|
|
||
| for (const entry of entries) { | ||
| const match = INDEXED_ARRAY_RE.exec(entry.fieldPath); |
There was a problem hiding this comment.
Don't classify numeric record keys as array indexes
This treats every profile field path ending in a numeric segment as an array element. Profile imports flatten ordinary objects before calling bulkSaveProfileValuesFn (src/components/configuration/ConfigPage.tsx:672-675), so a valid numeric record key such as mcpServers.foo.headers.404 is now grouped as an update to array path mcpServers.foo.headers; because the existing source is an object, the merge builds [] and PATCHes headers as an array with index 404 instead of preserving the record key. The previous scoped bulk save sent that flattened record path directly, so this corrupts scoped imports/updates for configs containing numeric object keys.
Useful? React with 👍 / 👎.
|
@codex review |
|
@codex review |
|
@codex review |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 21256edd05
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c5aa1a79a9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. Swish! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
|
Codex Review: Didn't find any major issues. Delightful! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary
I fixed array-object configuration saves so newly-added model spec entries and scoped overrides preserve array shape instead of overwriting index 0 or persisting numeric-key objects.
applyConfigEditso a pending whole-array edit remains authoritative when a newly-added entry is typed into.modelSpecs.listback intomodelSpecs.list.0.Change Type
Testing
bun test src/components/configuration/utils.test.tsbun run lintbun run buildSESSION_SECRET=0123456789abcdef0123456789abcdef bun run testTest Configuration:
Checklist