Title: feat(ashby): incremental job sync, custom field writes, and application lifecycle ops by mzxchandra · Pull Request #6703 · simstudioai/sim · GitHub
Open Graph Title: feat(ashby): incremental job sync, custom field writes, and application lifecycle ops by mzxchandra · Pull Request #6703 · simstudioai/sim
X Title: feat(ashby): incremental job sync, custom field writes, and application lifecycle ops by mzxchandra · Pull Request #6703 · simstudioai/sim
Description: Summary Extends the Ashby connector so a scheduled job/req sync can run incrementally, and adds the write path needed to annotate reqs and retract applications. Reads list_jobs accepts Ashby's syncToken and returns it as nextSyncCursor, turning a scheduled sync from O(all reqs) into O(changed reqs). Ashby only returns the token once the last page is drained, which the param description states. list_job_postings gains includeUnpublishedJobPostings, plus the posting status field. Without status a caller cannot tell a returned draft from a published posting, which makes the flag useless. Writes (new operations) customField.setValue / setValues — the only way to annotate a job or req, since Ashby has no job notes and no job tags. Writing null clears a value, so the annotation is reversible. application.delete — requires candidatesDelete, a module permission separate from candidatesWrite. application.changeSource — corrects source attribution on programmatically created applications. candidate.anonymize — strips PII; the record itself remains, because Ashby exposes no candidate deletion endpoint. Bug fix found while testing against a real Ashby org ashbyErrorMessage rendered Ashby's documented errors: [{message, parameter}] shape as [object Object], hiding the real cause. That is the form a 403 for a missing module permission arrives in. Destructive-write safety null clears a custom field, so every write here requires explicit intent before it can destroy data. This matters because the block's required markers only cover the editor: on the agent path a model calls the tool directly, so tools.config.params never runs and validateRequiredParametersAfterMerge skips a param marked not-required. set_custom_field_value rejects an absent or blank fieldValue; an explicit null still clears. change_application_source requires unsetSource to clear, and rejects a source ID and an unset request together — preferring either one silently discards the other. Ashby has no "leave unchanged" mode, so setting and clearing are the only two intents and exactly one must be expressed. The editor cannot produce the pair: the Source ID field is conditioned off while the clear switch is on. set_custom_field_values rejects an empty array locally rather than relying on Ashby. The custom field value parser is deliberately narrow rather than a blanket JSON.parse, which corrupts real text: 1e999 becomes Infinity and serializes back out as null — a clear; long numeric ids lose precision past 2^53; prose starting with { turns into an object. Only the literal keywords, {/[/" prefixes, and exactly round-tripping numbers decode. On the sync cursor's name Ashby calls it syncToken. Surfacing it under that name renders it [REDACTED] in block output, because syncToken matches the /^.*token$/i deny-list in redaction.ts — and an incremental sync is unusable if the operator cannot read the cursor the next run needs. An earlier revision of this PR fixed that by exempting syncToken from redaction globally. That was the wrong trade: it would have stopped redacting that field name product-wide, in any current or future integration, across execution traces, block output, the console, and telemetry — and the sharp edge was this block's own Sync Token input, where an operator pasting an API key would have had it stored verbatim. redaction.ts is untouched by this PR. The output is named nextSyncCursor instead, which is what it actually is — an opaque resumption marker, the same class as the cursor and nextCursor fields the redactor already leaves alone. This connector already translates Ashby's wire vocabulary on the way out (limit→perPage, results→jobs). The wire name and the request param stay syncToken, matching Ashby's docs, and the input keeps being redacted, which is the protective behaviour. A test pins the invariant: syncToken is sensitive by name, nextSyncCursor and nextCursor are not. Test Coverage Ashby-surface tests went 4 → 142. Full suite: 25,129 passed, 41 skipped, 0 failures (1,875 files). Every commit typechecks independently. Verified live against a real Ashby production organization, and end-to-end through the workflow editor: The sync cursor is returned only on the last page (confirmed two ways: a 2-page walk and a perPage=1 walk), and replaying it returns a strictly smaller result set. A custom field value can be written and then cleared with null, confirmed by reading the object back both times. includeUnpublishedJobPostings returns a strict superset, with status reporting Published / Draft. 11 distinct real Ashby error payloads all render readably. Every one was [object Object] before this branch. A 17-block edge-case workflow exercised stale/garbage sync tokens, perPage bounds, all five fieldValue encodings, empty and single-element setValues, and the three permission/not-found error paths. apps/sim/tools/ashby/ashby.live.test.ts is committed but inert by default: ASHBY_LIVE=1 ASHBY_API_KEY=... bunx vitest run tools/ashby/ashby.live.test.ts Add ASHBY_LIVE_WRITES=1 for the write phase. Note that vitest.setup.ts stubs global fetch for every file in the app, so the live file restores the real implementation and asserts the restore worked — without that guard the whole suite silently passes against a mock. Review Greptile 5/5. One Cursor Bugbot finding — a source ID and an unset request could be supplied together and the body preferred the source ID, turning an intentional clear into a set — fixed by rejecting the pair rather than picking a winner, and by making the editor unable to produce it. A Codex prototype-pollution concern was investigated and refuted: the redactor builds a fresh object via Object.entries, and JSON.parse never invokes the __proto__ setter. Known gaps The API key available for testing lacked candidatesDelete, so delete_application and change_application_source have error-path-only live verification. Their success paths are covered by mocks. In particular change_application_source's explicit-null unset is proven against mocks but not against the live API. delete_application's { applicationId } response shape comes from Ashby's OpenAPI spec, not an observed live response, for the same reason. Eight other Ashby list_* tools still understate perPage as "(default 100)" when Ashby caps at 100 and silently truncates. Pre-existing; only list_jobs was corrected here to avoid widening scope. Five other Ashby list_* tools still expose a syncToken output, which is redacted for the reason described above. Pre-existing, and renaming them would break any workflow already chaining the value, so it is left for a separate change. candidate.anonymize's response is persisted to execution traces like any other block output. If the endpoint echoes the pre-anonymization record, log retention could outlive the erasure. That is a platform-level retention question, not specific to this diff. Evals No prompt-related files changed — evals skipped.
Open Graph Description: Summary Extends the Ashby connector so a scheduled job/req sync can run incrementally, and adds the write path needed to annotate reqs and retract applications. Reads list_jobs accepts Ashby's...
X Description: Summary Extends the Ashby connector so a scheduled job/req sync can run incrementally, and adds the write path needed to annotate reqs and retract applications. Reads list_jobs accepts Ashby&#...
Opengraph URL: https://github.com/simstudioai/sim/pull/6703
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:57356db8-6b83-816c-a595-fdf92311a4d4 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | DE84:C4B81:A81448:E7EE28:6AFB516D |
| html-safe-nonce | 6febf9563f21ad80f77782f854f38e423b57851f1ca0008fa3e3a82a710ce8f5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERTg0OkM0QjgxOkE4MTQ0ODpFN0VFMjg6NkFGQjUxNkQiLCJ2aXNpdG9yX2lkIjoiOTA0MTcxNTM2NjA3MzE2MDA0NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | b2db13f12b6b62e0039c6bc645c66945959acbd3bb36a347b3d4a86619d131f0 |
| hovercard-subject-tag | pull_request:4282778515 |
| 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/6703/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 | Summary Extends the Ashby connector so a scheduled job/req sync can run incrementally, and adds the write path needed to annotate reqs and retract applications. Reads list_jobs accepts Ashby's... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7122bb414b542dba14d71a3f0b9f6fd2abce715b9f5912d082800563e6c806d1 |
| 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 | cbf66c024bb6d10e6955baa7413c54cf13a201bb |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width