Repository navigation
Simplify the agent host, the world and the gateway - #455
Merged
Merged
Conversation
The gateway stops synchronously: gateway.Start takes the Session's network namespace file and returns a stop that closes the listeners and every connection before it returns, so ownedView.end has stopped the gateway before Process.Wait returns. TestViewEndStopsTheGateway checks the order with the real gateway. The gateway serves one model provider with one endpoint; Model, the names, Endpoints.Placeholder and SessionNetwork are gone. The agent host hands the rewritten Provider to the Executor without a JSON round trip, links with *sandboxlink.AttachLink, and lists running tasks through an injectable function. The agenthost and worldfs Error structs give way to fmt.Errorf with the same sentinels. worldfs embeds go-fuse's default RawFileSystem in place of its own ENOSYS and no-op methods, and TestUnsupportedErrnos checks the errnos for the operations TestPOSIX skips. The worldfs tests no longer wait on the world they serve while holding a P: each test mount answers the kernel's first poll the way go-fuse's WaitMount does, and TestInstanceChanged faults its private mapping in with madvise. On one CPU, or during a stop-the-world, either wait deadlocked the test with its own world. The gateway's view test serves a fileservicetest world through worldfs. MiniMax Code writes config.yaml and mcp.json once, from configuration built in memory, with the same bytes as before. The View: nil syntax test is gone; TestRegistryResolvesOnlyDeclaredViews covers the behaviour.
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.
B4 simplicity audit, lane L4: the agent host, the world and the gateway. Net −143 production lines.
Defect fixed: the gateway stops before a view's end is reported.
agenthost/doc.gopromises that the gateway has stopped before the Process reports the view's end. Before this change,ownedView.endcancelled a context and moved on, while the gateway closed incontext.AfterFunccallbacks. Now:gateway.Startreturns a synchronous stop, andendwaits for it.connSettracks every connection in both directions: accepted, dialed upstream, HTTP/2, upgraded MCP and CONNECT tunnels. A connection leaves the set only after it has closed. Adding to a closed set resets the connection.TestStopClosesEveryConnectionfailed 4 of 20 runs against the previous gateway; it passes every run now.Deletions:
Endpoints.PlaceholderandSessionNetwork;CloseIdleConnectionsand the transport list;fileservicetestplusworldfs.Errorstruct, replaced by%wwrapping with the same sentinels;attachLinkinterface;processTable/procfs, replaced by an injectable task-listing function;handoff.Errorstruct;fuse.NewDefaultRawFileSystem(), with errno assertions.View: nil.config.yaml,workspace-profile.jsonandmcp.jsonare built in memory and written once each. The bytes match the previous output in 7 modes.Test-only fix: two worldfs tests hung on one CPU, because the test process both serves the FUSE world and touches it. They now pre-poll go-fuse's epoll file and fault a mapping in with
MADV_POPULATE_READ. Production never opens world files in its own process.Testing:
--cpuset-cpus=0.-count=50.-race -count=50.Blind review (Codex) asked for the complete stop; this PR includes it.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.