Skip to content

Deploy Agent Builder definitions through the native source pipeline (CL-7363) - #560

Merged
TheGreatAxios merged 7 commits into
cl-7362-deploy-approvalfrom
cl-7363-agent-builder-native
Sep 2, 2026
Merged

Deploy Agent Builder definitions through the native source pipeline (CL-7363)#560
TheGreatAxios merged 7 commits into
cl-7362-deploy-approvalfrom
cl-7363-agent-builder-native

Conversation

@TheGreatAxios

@TheGreatAxios TheGreatAxios commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Agent Builder (POST /api/tenants/:tenantId/agent-definitions and every other content-mutating agent-directory route) used to self-freeze its definition through @corbits/workflow-freeze's DefinitionFreezer, a hub-local path that bypasses the native sidecar probe.
  • Cut over to the WorkflowDeployer @corbits/agent-workflow-authoring's registry already calls: write the source tree via AssetService.populateAsset, then deploy the resulting commit through sessionService.deployWorkflowFromSource (install -> sidecar probe -> gate -> freeze). Wired in apps/hub/src/index.ts at all four agent-directory route mounts.
  • A sidecar-unavailable deploy now returns the same 502 unavailable envelope the native deployments route uses — no fallback to freezing.
  • Removed the @corbits/workflow-freeze dependency from @corbits/agent-directory entirely (package.json + every import); added a source-grep regression test guarding against it creeping back.
  • No data migration: an already-frozen definition stays launchable as-is; its next edit redeploys natively. Updated docs/AGENTS-PAGE.md's "Creating an agent" section accordingly.

Links https://linear.app/abklabs/issue/CL-7363

Remaining workflow-freeze importers (out of scope — CL-7364 owns deletion)

  • packages/workflow-freeze/src/index.ts (the package itself)
  • apps/hub/src/index.ts — still imports freezeInertWorkflowDefinition for the unrelated template-block freeze path
  • packages/workflow-catalog/test/block-workflow-freeze.test.ts
  • package.json dependents: packages/workflow-catalog, apps/hub

Test plan

  • bunx tsc --noEmit -p packages/agent-directory
  • bunx tsc --noEmit -p apps/hub
  • bun test packages/agent-directory packages/agent-workflow-authoring (256 pass, 21 skipped DB-gated suites — no local DATABASE_URL)

Resolves CL-7363

@TheGreatAxios
TheGreatAxios force-pushed the cl-7363-agent-builder-native branch from 0201645 to 16c7978 Compare September 2, 2026 07:44
@TheGreatAxios
TheGreatAxios changed the base branch from cl-7361-native-deploy to cl-7362-deploy-approval September 2, 2026 07:45
@TheGreatAxios
TheGreatAxios force-pushed the cl-7363-agent-builder-native branch from 16c7978 to cebb8bf Compare September 2, 2026 08:48
@TheGreatAxios
TheGreatAxios force-pushed the cl-7363-agent-builder-native branch from cebb8bf to cefe2b3 Compare September 2, 2026 09:13
@TheGreatAxios
TheGreatAxios force-pushed the cl-7363-agent-builder-native branch from cefe2b3 to 89f86bf Compare September 2, 2026 09:31
A create or PATCH-carried retarget now must clear the same two gates
before it is persisted: resolveLaunchableDefinition must resolve the
asset, and the acting principal must be authorized for
workflow-definition:<id>/read — the same verb listRoutineTargets
already checks per row. A denial is a typed 403 alongside the
existing 400/404/409 target envelopes, on both the tenant-session and
Myra's workflow-run-authenticated routine surfaces.

Also routes a pre-existing catch in postRoutineEnabledNotice through
reportError, since this change's diff now touches that line and
check:report-error requires it.
Route tests that asserted DefinitionFreezer freeze/refreeze calls now
assert the injected WorkflowDeployer is called with the commit each
write produces, and a new source-grep test asserts this package never
imports @corbits/workflow-freeze (CL-7363).
Every content-mutating agent-directory route (create, restore,
capability add, instructions edit, skills edit, skill pin) used to
self-freeze its definition through @corbits/workflow-freeze's
DefinitionFreezer, a hub-local path that bypasses the native sidecar
probe. Cut over to the same WorkflowDeployer the agent-authored-workflow
registry calls: write the source tree, then deploy the resulting commit
through install -> sidecar probe -> gate -> freeze. A sidecar-unavailable
deploy now returns the same 502 envelope the native deployments route
uses, with no fallback to freezing. Removes @corbits/workflow-freeze
from agent-directory's dependencies entirely.
AGENTS-PAGE.md's "Creating an agent" steps described a workflow.json
write followed by ensureWorkflowDefinitionForAsset; describe the actual
source-tree write, native deploy, and resulting frozen definition
instead, and note that a pre-CL-7363 definition stays launchable as-is
and only redeploys natively on its next edit.
@TheGreatAxios
TheGreatAxios force-pushed the cl-7363-agent-builder-native branch from 89f86bf to b3aa796 Compare September 2, 2026 10:56
@TheGreatAxios
TheGreatAxios marked this pull request as ready for review September 2, 2026 11:09
@TheGreatAxios
TheGreatAxios merged commit 4396553 into main Sep 2, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant