Repository navigation
Conversation
Phase 4b, second half. Six places each spawned the sidecar, wrote the request and parsed the answer with their own wording and deadlines: the invoker behind every diagram edit, the chat's invokeSidecarOp and exportWorkflowGraph, the model source's graph export, the openability probe and the raw sidecar.send command. sidecar-transport.ts is the one; the answer is the last line the sidecar prints, so one that logs above it is still read. exportWorkflowGraph is gone: the export is an op like the others. The graph-export op has one default, exportGraph, which every sidecar answers to. The model source used to pick exportNetworkGraph or exportWorkflowGraph by acquisition strategy and ignore the product's exportOp; it now sends the product's, carried by SidecarRuntimeConfig. Claude-Session: https://claude.ai/code/session_01EToj6RJRMSSHQiqGNMU9wv
A process failure is reported as the child-process module describes it, command and stderr included, with the op; the model source prefixes the command only on a refused or garbled answer, where it is not already named. The answer is read whole when it is one JSON document and by its last line when the sidecar logs above it. The openability probe takes an empty answer for no answer again. Every request runs from the file's Python package root with it on PYTHONPATH, the diagram's own edits too, so one sidecar sees one environment. DEFAULT_EXPORT_OP lives beside the transport and the profile uses it. Merges the helper branch's review fixes. Claude-Session: https://claude.ai/code/session_01EToj6RJRMSSHQiqGNMU9wv
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.
Phase 4b of the declutter plan, second half. Stacked on #122 (it uses the
source-files.tshelpers that PR introduces); the base moves tomainonce #122 lands.Six transports, one
Each of these spawned the sidecar, wrote
{ file, op, args }on stdin and parsed stdout with its own wording, its own deadline and its own idea of an empty answer:SidecarInvoker.invokeSidecar(every diagram edit)invokeSidecar({ command, file, op, args })invokeSidecarOp(chat edit backend, registry tools, capabilities, openability's sibling)pythonPackageRoot: trueexportWorkflowGraph(chatexportGraph)undefinedexportGraphsends the export op throughinvokeSidecarOpand readsdiagnostic.graphtryLoadGraphFromSidecar(model source)invokeSidecar({ ..., timeoutMs, pythonPackageRoot: true }), then the same graph handlingprobeDiagramOpenabilityinvokeSidecar({ ..., timeoutMs: 20 s });ok→ true,status: 'error'→ false, else unknownsidecar.sendcommandinvokeSidecar(...)→{ ok, message }sidecar-transport.tsnever throws; it describes a child that could not start, timed out or exited non-zero withdescribeChildFailureplus the op, carriesstderr,code(fromdiagnostic.code) andtimedOut, and reads the last non-empty stdout line, so a sidecar that logs above its answer is still understood (the openability probe did this; the other five would have failed on the log line). The diagram's own edits still run without the package-root cwd/PYTHONPATH, as before; the requests that import the file (export, chat edits) keep it.One graph-export default
All four sidecars answer
exportGraph(wfpy and calpy alias it to their older names; hdl and ndf accept all three). The model source used to pickexportNetworkGraphorexportWorkflowGraphby acquisition strategy and ignore the product'sexportOp(sv saysexportModuleGraphand only worked through hdl-sidecar's aliases); registry tools and the chat defaulted toexportWorkflowGraph. Now:SidecarRuntimeConfig.exportOpis filled from the profile input, and every sender usesexportOp ?? DEFAULT_EXPORT_OP('exportGraph').What the review made of it
describeChildFailuresays (command and stderr) plus the op, for every failure kind;failure: 'start' | 'timeout' | 'exit' | 'rejected' | 'invalid-json'says which, and the model source prefixes the command only where the message does not already carry it.okwith a response is yes;status: 'error'is no; nothing is unknown, as before. The dead payload object and the catch around a call that never throws are gone.pythonPackageRootflag kept two environments for one sidecar. Every request now runs from the file's package root with it onPYTHONPATH, the diagram's own edits included; stated in the changelog.DEFAULT_EXPORT_OPlives insidecar-transport.ts(re-exported bysidecar-graph-export.ts), and the profile's literal uses it.Tests
sidecar-transport.test.tsmocks the child process and pins the request line, last-line parsing, the empty answer, a rejected request with its code, exit/timeout/spawn failures with stderr, the deadline, and that nothing throws.chat-edit-backend.test.tsasserts the export throughinvokeSidecarOp; two characterization tests now expectexportGraph. Typecheck 5/5, neutrality 5/5, toolkit 336 with the known local wizard timeouts (green alone, green in CI).https://claude.ai/code/session_01EToj6RJRMSSHQiqGNMU9wv