Commit b8e5039
Ricardo DeMatos
fix(managed-agent): address 3 medium-severity review comments
Follow-up on Cursor Bugbot's review of the last few commits. Three
related, but independent, correctness fixes.
Files were silently dropped from cloud sessions
- The cloud block declares `columns: ['File ID', 'Mount path']`. The
table subblock stores each row's cells keyed by exactly those
column strings — but `normalizeFiles` only knew about `Key`/`Value`
(older shape) and flat `{fileId, mountPath}`, so every file row was
dropped and no files ever reached the session.
- Fix: `normalizeFiles` now recognizes `File ID` / `Mount path`
(block's declared columns), `file_id` / `mount_path` (snake case),
the older `Key` / `Value`, and the flat `{fileId, mountPath}`
shapes. Regression test added.
Stale collapsed-row labels when Claude Workspace changes
- The managed-agent collapsed rows hydrate friendly names by reading
the SIBLING `connection` value from `allSubBlockValues`. But
`SubBlockRow`'s memo compare only checked this row's own value, so
the memo would keep showing agent/env/vault/memory labels tied to
the previous connection until each row's own stored value happened
to change.
- Fix: extend `areSubBlockRowPropsEqual` to also compare a small set
of known sibling-dependency keys (`connection`, `oauthCredential`,
`credential`). Any of them changing invalidates the memo so the
hydration hooks re-run with the new sibling value.
Empty tables re-seeded deployer defaults on remount
- The table init effect early-exited when `storeValue.length > 0`,
but treated `[]` as "unseeded" and re-ran `fetchDefaultRows` /
`defaultRows`. A self-hosted block whose Session-parameters table
was intentionally cleared to zero rows would get repopulated on
every remount, clobbering the author's choice.
- Fix: only seed when `storeValue === undefined || storeValue === null`.
A stored `[]` — the author's explicit "no rows" — is now preserved.
Tests: 92 pass (30 normalizer, up from 29; regression test for the
`File ID` / `Mount path` shape).1 parent 1a4389f commit b8e5039
4 files changed
Lines changed: 57 additions & 18 deletions
File tree
- apps/sim
- app/workspace/[workspaceId]/w/[workflowId]/components
- panel/components/editor/components/sub-block/components/table
- workflow-block
- tools/managed_agent
Lines changed: 8 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
265 | 265 | | |
266 | 266 | | |
267 | 267 | | |
268 | | - | |
269 | | - | |
| 268 | + | |
| 269 | + | |
270 | 270 | | |
271 | 271 | | |
272 | 272 | | |
273 | 273 | | |
274 | | - | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
275 | 279 | | |
276 | 280 | | |
277 | 281 | | |
278 | | - | |
| 282 | + | |
279 | 283 | | |
280 | 284 | | |
281 | 285 | | |
| |||
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
109 | 121 | | |
110 | 122 | | |
111 | 123 | | |
| |||
116 | 128 | | |
117 | 129 | | |
118 | 130 | | |
| 131 | + | |
119 | 132 | | |
120 | 133 | | |
121 | 134 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
116 | 132 | | |
117 | 133 | | |
118 | 134 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
47 | 52 | | |
48 | 53 | | |
49 | 54 | | |
| |||
57 | 62 | | |
58 | 63 | | |
59 | 64 | | |
| 65 | + | |
| 66 | + | |
60 | 67 | | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
66 | 73 | | |
67 | 74 | | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
73 | 79 | | |
74 | 80 | | |
75 | 81 | | |
| |||
0 commit comments