computer: Fix issues found by a deployed test of the stack - #190
Open
mattzcarey wants to merge 5 commits into
Open
mattzcarey wants to merge 5 commits into
mattzcarey wants to merge 5 commits into
Conversation
ws:git accepts a leading -C <path> in cli, but its description for the model did not say so, so a model reading it had no reason to use it.
…ut assets A remote client's assets getter returned the stub's assets property, which over RPC is always a placeholder, never undefined. createAITools therefore offered publish on a remote client even when the Workspace had no assets publisher, and calling it failed because the receiver did not implement assets. The Workspace stub now exposes a plain hasAssets boolean, which the client reads once when it is created, as it already does for useThink. A client without assets reports undefined, locally and remotely.
…eanly
A run that returned { kept: 1, dropped: undefined } failed with "must
be JSON-compatible values", although the result is framed as JSON,
which drops undefined fields. Values like that are common in ordinary
code, so the check now treats an undefined field as absent.
The isolate's early size check walked arguments without tracking what
it had seen, so a cyclic argument overflowed the stack. It now stops
at a repeated object and reports that values must be acyclic, the same
wording the host uses.
ws:container returned the exit code and output but dropped the sync result, so code that called exec could not tell whether the container's file changes had reached the Workspace, or which ones the Workspace had refused. exec now also returns sync: its status, the skipped paths, and the error when the pull is still pending. The module's description and the docs also say the sync is last-writer-wins, because a file the isolate writes while the command runs is replaced by the container's version without being reported as skipped.
🦋 Changeset detectedLatest commit: ba0b9d8 The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
A command that wrote thousands of files into a read-only mount made the sync summary larger than the bridge's response limits allow. exec then failed after the command had already run and its changes had been pulled, losing the exit code and inviting a retry that repeats the side effects. The summary now lists at most 100 skipped paths, adds skippedCount with the full count, and cuts a pending sync's error to 1 KiB.
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.
Stacked on #189.
These fixes come from running the stack on a deployed Worker and trying to break it. The lab Durable Object had a JavaScript backend with
ws:container,ws:git, a host module, and a source module, plusWorkerShellBackendandContainerBackend, driven throughcreateAIToolsboth locally and throughgetWorkspace(stub). Each fix is its own commit.Remote clients offered a
publishthat failed. A remote client'sassetsgetter returned the stub's property, which over RPC is always a placeholder.createAIToolsbuilt fromgetWorkspace(stub)therefore offeredpublishon a Workspace with no assets, and calling it failed with "The RPC receiver does not implement the method assets". The stub now exposes a plainhasAssetsboolean, read once when the client is created, asuseThinkalready is.A result with an
undefinedfield failed the run.The result is framed as JSON, which drops the field anyway. Values like this are common in ordinary code, so the check now treats an
undefinedfield as absent.A cyclic argument overflowed the stack. The isolate's early size check (#183) walked arguments without tracking what it had seen. It now stops at a repeated object and reports "must be acyclic", the same wording the host uses.
ws:containerdropped the sync result.execnow also returnssync:pendingmeans the container's file changes have not reached the Workspace yet, andskippedlists paths the Workspace refused, such as files in a read-only mount. The list is capped at 100 withskippedCountgiving the full count, and the error is cut to 1 KiB, so a large skip can't push the result past the bridge's limits after the command has run. The lab showed one more case the report cannot catch. A file the isolate writes while the command runs is replaced by the container's version, without being reported as skipped. The module's description anddocs/17_isolate_javascript.mdnow say the sync is last-writer-wins.ws:git's description didn't mention-C, althoughcliaccepts a leading-C <path>.Script runner tests check the cyclic-argument error and the dropped
undefinedfield in a real Dynamic Worker, and both fail without their fixes.client.test.tschecks that local and remote clients without assets leavepublishout. The container module tests cover a pending sync with skipped paths.