You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#628 moved only the web-specific plugin-data directory out of the artifact (~/.agent-bundle/web-data/<plugin>-<digest>/<server>). The framework's own generated state owner still anchors inside the installed artifact:
resolveWebLaunch() (packages/agent-bundle/src/web-host/launch.ts) sets AGENT_BUNDLE_PLUGIN_ROOT to the installed artifact — correctly, that is the code root.
generatedStateOwner() (packages/agent-bundle/src/build/entry-shell.ts), the lineage journal, the notice store, and the standalone hook wrappers (adapters/hook-contract.ts) open the SQLite driver at pluginRoot.stateRoot.
So a plugin with a conventional workspace-durable src/state.ts tries to create SQLite files under the installed artifact, which may be read-only (marketplace caches, chmod -R a-w installs, shared installs). A read-only install fails to serve its first state-writing tool.
Required change
Separate the code root from the framework state root in the runtime launch/resolution contract:
plugin.root (AGENT_BUNDLE_PLUGIN_ROOT) keeps pointing at installed code and assets. It is never pointed at a data directory.
A distinct writable state root is resolved identically by every generated shell that shares state — the stdio MCP entry, its Flight worker, the artifact CLI bin and its render worker, the standalone hook wrappers — keyed like the web-data directory (plugin segment + root digest) so two installs never share state and a read-only install launches.
An explicit environment override (AGENT_BUNDLE_STATE_ROOT) stays supported and documented as the override, not a workaround.
Packed-pool regression test: build a plugin with a generated MCP server, a web-exposed App and workspace-durable state; make the artifact read-only; launch with no custom state env; invoke a state-writing tool; assert success, that nothing was written beneath the artifact, and that the MCP process and the CLI bin observe the same state.
Docs (en + zh) describe the contract; changeset (agent-bundle, @agent-bundle/runtime, minor) notes that existing installs relocate their state.
Problem
#628 moved only the web-specific plugin-data directory out of the artifact (
~/.agent-bundle/web-data/<plugin>-<digest>/<server>). The framework's own generated state owner still anchors inside the installed artifact:resolveWebLaunch()(packages/agent-bundle/src/web-host/launch.ts) setsAGENT_BUNDLE_PLUGIN_ROOTto the installed artifact — correctly, that is the code root.resolvePluginRoot()(packages/rsc-runtime/src/plugin-root.ts) computesstateRoot = join(root, 'state').generatedStateOwner()(packages/agent-bundle/src/build/entry-shell.ts), the lineage journal, the notice store, and the standalone hook wrappers (adapters/hook-contract.ts) open the SQLite driver atpluginRoot.stateRoot.So a plugin with a conventional workspace-durable
src/state.tstries to create SQLite files under the installed artifact, which may be read-only (marketplace caches,chmod -R a-winstalls, shared installs). A read-only install fails to serve its first state-writing tool.Required change
Separate the code root from the framework state root in the runtime launch/resolution contract:
plugin.root(AGENT_BUNDLE_PLUGIN_ROOT) keeps pointing at installed code and assets. It is never pointed at a data directory.AGENT_BUNDLE_STATE_ROOT) stays supported and documented as the override, not a workaround.Acceptance
agent-bundle,@agent-bundle/runtime,minor) notes that existing installs relocate their state.Follow-up to #628; part of #592.