Title: fix(forks): stop sync demanding config the source never had by mzxchandra · Pull Request #6766 · simstudioai/sim · GitHub
Open Graph Title: fix(forks): stop sync demanding config the source never had by mzxchandra · Pull Request #6766 · simstudioai/sim
X Title: fix(forks): stop sync demanding config the source never had by mzxchandra · Pull Request #6766 · simstudioai/sim
Description: What Workspace fork sync manufactured required re-pick rows the source never asked for, disabling Sync and suppressing the "Fully mapped" badge. Two independently-reported symptoms turned out to be two distinct root causes landing on the same line in collectForkDependentReconfigs. Symptom A — an Agent block whose tools include Jira Get Issue, with Select Issue deliberately blank so the agent resolves it at runtime. The modal demanded a value. Symptom B — a Jira block on write whose Select Project was blank in the source. A required row appeared under the credential card. Toggling the field to manual-input mode and redeploying made the demand vanish. Why Cause A — a block-level required applied to a nested tool param emitAnchoredDependents() runs over two structurally different things: a block's own subblocks, and the params of each tool inside a tool-input. The nested pass read the raw block config and stamped required: isSubBlockRequired(...). Jira's issueKey subblock declares required: { field: 'operation', value: ['read', …] }, so a Get Issue tool evaluated operation === 'read' → required: true. But Sim already models this as ParameterVisibility: the tool param is issueKey: { required: true, visibility: 'user-or-llm' }. Every other consumer honors that — the tool-row editor strips required for anything not user-only, and createLLMToolSchema keeps an empty param in the model's schema so the model can fill it. The fork collector was the only surface that didn't. The editor's own verdict on the same field: Domain * and Jira Account * carry asterisks; Select Project and Select Issue do not. Cause B — demanding configuration the source never had projectId hangs off the credential anchor, so a blank one was emitted as a required row. The asymmetry that proves it's a collector bug rather than a data bug: only members carrying a selectorKey are emitted, so the basic selector gated while its advanced twin manualProjectId — identical required and dependsOn, no selectorKey — did not. The same empty configuration blocked or didn't purely on a display preference. That's also why the manual-mode workaround worked: the toggle writes canonicalModes.projectId = 'advanced', and the dormant-member guard skips the row. Not the remapper. A Jira project isn't a remappable kind — project-selector maps to selector-resource, absent from REGISTRY_KIND_TO_FORK_KIND, so it never reaches unmappedRequired. Neither fix subsumes the other The emptiness fix alone leaves a populated user-or-llm param gating after a parent swap, because effectiveDependentValue blanks the stored value whenever the parent changed in-session. The visibility rule alone never touches top-level subblocks. How One predicate at the single out.push site, expressing two independent invariants: A sync carries the source's configuration across; it never invents configuration the source never had. Applies to every dependent. Inside a tool-input, only a user-only param is the user's to supply. Applies to the nested pass, where visibility is known. The tool-row rule is extracted to apps/sim/lib/workflows/tool-input/param-visibility.ts and used by both the editor and the sync gate, so they can't drift. Visibility comes from getToolInputParamConfigs — the same resolver the rest of fork remapping already uses. Unknown schemas (custom-tool / MCP / unresolvable tool id) fail closed to the pre-existing gate. Rows are still emitted either way — only the gating flag changes — so no stored dependent value is orphaned and no row disappears. The predicate is written as the positive === 'user-only', never a user-or-llm || llm-only denylist: the two non-user visibilities reach the same verdict for different reasons, and a denylist would silently mis-classify any visibility added later. Blast radius ~110 required selector dependents across ~45 blocks stop gating when blank in source. Populated ones still gate everywhere — verified on the knowledge-base anchor, which is a different code path from the credential anchor. Untouched: mapping entries themselves (mapping-service.ts hardcodes required: true, and a blank credential never becomes an entry), nested user-only params with a value, requiredComplete, syncDisabled, and the cleared-ref blocker list. Verification Fork diff before → after, against a workflow built and deployed through the real editor: Block Field Before After Jira Write projectId true false Cause B Jira Read Pinned issueKey true true control — still gates Agent Blank tools[0].issueKey true false Cause A+B Agent Pinned tools[0].issueKey true false Cause A only (sourceValue: ACME-999) KB Blank Doc documentSelector — false KB anchor KB Pinned Doc documentSelector — true KB anchor control Row count unchanged (7 → 7). Push and pull directions produce identical flags. End-to-end through the UI, on a forked workspace: Credential mapped → badge reads "Fully mapped", Sync enabled. A populated required row emptied → Sync disabled, reason "Reconfigure all required fields first". Re-picked a document → persisted as documentSelector = doc_child → after sync the target block holds doc=doc_child. Two real syncs ran: credential remapped cred_jira_a → cred_jira_child, KB kb_parent → kb_child, blanks preserved. Repeat sync idempotent (no duplicate workflows); rollback {"restored":1} with the undo consumed; unlink left parent: null. Tests apps/sim/lib/workflows/tool-input/param-visibility.test.ts (new), dependent-field-noun.test.ts (new), plus 12 cases added to dependent-reconfigs.test.ts. Every behavioral case was verified to fail without the fix, not just pass with it. Full apps/sim suite: 1,968 files / 26,289 tests passing. turbo run type-check clean across all 24 workspaces. check:api-validation passes. Review findings fixed in-branch The pre-landing review caught a real defect in the first commit, fixed in 3ca8d29: Silent un-gating on non-string values. The predicate asked isNonEmptyValue about rawSourceValue, which flattens every non-string to '' for the wire contract. A multi-select dependent stores an array, so a populated one reported blank and stopped gating. Reachable today via zoho-desk departmentIds. Now asks the raw value. Canonical id is an alias — no longer clobbers a param owning that key as its own paramId. A test asserting .every() over an empty array (vacuously true) now pins both shapes. The indexer mock is reset per test, so the new cases aren't order-dependent. Placeholder copy: Select ${title.toLowerCase()} rendered "Select select issue" for titles that already read as instructions. Extracted and tested; a bare "Select" title now falls back instead of rendering "Select " / "No found". Security specialist: no findings. Deliberately out of scope human_in_the_loop. Its notification subblock is also a tool-input, but its tools execute directly with no model, so a user-or-llm blank there genuinely is missing. This change stops fork sync gating on it. The gap already exists in the editor — the HITL tool row shows no asterisk and saves blank — so fork sync was only masking it, and only for forked workspaces. The fix is editor-side (give those params explicit visibility: 'user-only', which re-gates them through this same rule). Separate PR. Jira condition gating (sibling in-flight PR). It shrinks the blast radius but does not fix Cause B — write / read-bulk / get_project legitimately show the selector. Independent; can land in either order. Note for affected users The toggle-to-manual workaround persists advanced into those workflows, which changes which member serializes. Harmless while both fields are empty, but if anyone later picks a project in the basic selector it will be silently dropped. Not auto-migrated — those blocks want toggling back by hand.
Open Graph Description: What Workspace fork sync manufactured required re-pick rows the source never asked for, disabling Sync and suppressing the "Fully mapped" badge. Two independently-reported symptoms turned...
X Description: What Workspace fork sync manufactured required re-pick rows the source never asked for, disabling Sync and suppressing the "Fully mapped" badge. Two independently-reported symptom...
Opengraph URL: https://github.com/simstudioai/sim/pull/6766
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:a57340a7-8670-f747-9b6f-77a97baad55d |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | C6E6:A5723:5E013A:85B3DD:6AFB43E7 |
| html-safe-nonce | d5c404c6a8b2a62d1de09ea3e54d664e0efd6365f462bea811a9fdc4cf284f33 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNkU2OkE1NzIzOjVFMDEzQTo4NUIzREQ6NkFGQjQzRTciLCJ2aXNpdG9yX2lkIjoiNzQ0NzM4MzMyMjA4MzkzNTIwNyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | d64682d75364033953a99bd553e547941b87d2145ffe795a7d797fee0ea7f544 |
| hovercard-subject-tag | pull_request:4289220687 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/simstudioai/sim/pull/6766/files |
| twitter:image | https://avatars.githubusercontent.com/u/129460234?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/129460234?s=400&v=4 |
| og:image:alt | What Workspace fork sync manufactured required re-pick rows the source never asked for, disabling Sync and suppressing the "Fully mapped" badge. Two independently-reported symptoms turned... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | d849b928f455c800985398e7f1b659425adb312a5fa14fba5d9a14e62e9fe5dd |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/simstudioai/sim git https://github.com/simstudioai/sim.git |
| octolytics-dimension-user_id | 199344406 |
| octolytics-dimension-user_login | simstudioai |
| octolytics-dimension-repository_id | 912559512 |
| octolytics-dimension-repository_nwo | simstudioai/sim |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 912559512 |
| octolytics-dimension-repository_network_root_nwo | simstudioai/sim |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | a6c2f87cbcb6414452377b4967858ed6a66f1109 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width