mirror of
https://github.com/coder/coder.git
synced 2026-06-04 21:48:22 +00:00
01f9e4b4be
Boot the agentcontext.Manager during agent init, seed its sources from the existing CODER_AGENT_EXP_*_DIRS env vars, run its watcher/resolver loop in the graceful context, and tear it down in agent.Close. Mount the source CRUD and resync HTTP API at /api/v0/context. Connect to coderd via the new ConnectRPC210WithRole and push each snapshot via DRPCPusher. The push goroutine is registered through a new startAgentAPI210 helper that exposes the v2.10 client. When the manifest lands, trigger a Resync so the snapshot reflects the workspace directory immediately instead of waiting for the next filesystem event. Add agenttest.Client.ContextStatePushes and a FakeAgentAPI PushContextState implementation so tests can assert on the push traffic, plus an end-to-end test that boots a real agent against the fake and verifies AGENTS.md appears in a snapshot.