Repository navigation
Conversation
Sidecars need repository access and shared address helpers without loading the Hub database layer during startup.
Broad imports loaded unused execution code and eagerly constructed the complete control-payload union. Import the individual channel modules so the supervisor uses the existing per-kind validation path.
The receiver already authenticates and validates each event. Return the canonical event type so forwarding does not parse it a second time.
FarinM
deleted the
intr-652-reduce-startup-latency-cpu-time-and-memory-use-in-sidecars
branch
October 12, 2026 22:47
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After #216 narrowed the probe and workflow children, the parent sidecar still loaded framework code it never executes. Imports for small helpers pulled in Hub database services, broad type/schema barrels, and the agent execution runtime. The supervisor also imported the aggregate control channel, which constructs every control-message validator and the combined union at import time. ArkType compiles validators as those schemas are constructed, so each sidecar paid initialization and memory costs for unused dependencies before connecting to the Hub.
This narrows the sidecar's startup graph and removes a redundant event validation pass:
@intx/hub-sessions/substratefor repository access. MoveworkflowSourceAssetMountPathinto@intx/types/workflow-sourcesand replaceparseAgentIdwith the existingderiveWorkflowRunId. Deployment code calls the shared helpers directly; the injection fields and duplicate test and benchmark helpers are removed.@intx/agent/authoring; workflow inspection uses the definition/projection entries.inlineBodyReflives in a leaf module so the probe does not load body rewriting code through the projection entry.parseInferenceEventand forward the canonicalInferenceEventresult directly.EventPayloadremains a type alias; its redundant validator export is removed.process-boot-graph.test.ts.Measurements are medians of 12 alternating runs in fresh processes per variant on macOS arm64 with Bun 1.4.3, comparing the branch's base (
f9c940190) withc9aaca55f. Each run uses an empty data directory and a local WebSocket stub. Startup is measured from process spawn to the firsthello; CPU time and RSS are sampled just afterward. These cover startup with no deployments, not workflow throughput or memory under sustained load, and do not quantify the saving from removing the second event validation pass.Removed exports have no remaining in-repository callers. Run ID validation still uses
parseRunAddress; invalid-address diagnostics now usederiveWorkflowRunId's JSON-escaped formatting.Validation:
make allpassed with 10,137 tests passing and two live Google API tests skipped. The first commit also passed the focused 301-test suite independently, including its guard against database imports in the sidecar.