Skip to content

feat: provide resource manipulation tools for remote agents - #115

Open
maxy-shpfy wants to merge 1 commit into
maxy/feat--precise-remote-env-selector-for-spawning-new-agentsfrom
maxy/feat--agents-tools-session-resources
Open

maxy-shpfy wants to merge 1 commit into
maxy/feat--precise-remote-env-selector-for-spawning-new-agentsfrom
maxy/feat--agents-tools-session-resources

Conversation

@maxy-shpfy

@maxy-shpfy maxy-shpfy commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

Description

A remote environment can add, list, and read session resources over the /remote-env socket, through the same catalog path the HTTP resource routes use. An agent on one host can contribute a file, a host entry, or a memory write, and Prime or an agent on another machine can fetch it.

  • Shared protocol: ack events remote:resource:add, remote:resource:list, and remote:resource:read. RemoteResourceInput reuses HostResourceInput, so a file write (bytes under uploads/, binary as base64), a host entry, and a memory write share one catalog path.
  • Gateway: useResources wires the catalog, the spawn-preamble refresh, and the room notifier. Adds go through applyResourceInput. Lists scan the workspace, then return the catalog. Reads stay inside the session's uploads/ and artifacts/ trees, reject a uri that escapes that root, cap the payload at MAX_FILE_RESOURCE_BYTES, and return base64 plus a content type derived from the extension. Authorization reuses the room-read gate.
  • Socket.IO maxHttpBufferSize matches MAX_JSON_BODY_BYTES, so a file at the 1 MiB cap still fits once base64 and the ack envelope are included.
  • @tangent/remote-subagent: addResource, listResources, and readResource (30s ack timeout), documented in the package README.

How to test

  1. pnpm --filter @tangent/server test — remoteEnvironmentGatewayResources.test.ts covers a file add/read/list round trip, a uri that escapes the session root, a session-scoped host writing another session, and an add when the catalog is not wired.
  2. pnpm --filter @tangent/remote-subagent test — client ack success and rejection for add, list, and read.

Notes

Builds on #111. Next in the stack is #112; calling these methods from the local agent host is follow-up work.


Stack created with GitHub Stacks CLI • Give Feedback 💬

@maxy-shpfy
maxy-shpfy added this pull request to stack #116 October 21, 2026 00:54
@maxy-shpfy
maxy-shpfy marked this pull request as ready for review October 23, 2026 23:26
@maxy-shpfy
maxy-shpfy requested a review from camielvs October 23, 2026 23:28
@maxy-shpfy
maxy-shpfy force-pushed the maxy/feat--agents-tools-session-resources branch from e515466 to 5257b70 Compare October 27, 2026 23:13
@maxy-shpfy
maxy-shpfy force-pushed the maxy/feat--agents-tools-session-resources branch from 5257b70 to eaec694 Compare October 28, 2026 23:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant