From 8d3631d6b9ce8d4d8d8c20e717dc89167215317e Mon Sep 17 00:00:00 2001 From: Ismael Martinez Ramos Date: Tue, 8 Sep 2026 08:12:54 +0100 Subject: [PATCH] docs: record client lifetimes in AGENTS.md and point at the contributing guide Provider clients outlive a conversation in serve a2a and serve mcp, which is not visible from the provider code. The command table also duplicates the contributing guide, so name that page as canonical rather than copying it. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01Qyjba1txhq3QsrpcGUt3FM --- AGENTS.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/AGENTS.md b/AGENTS.md index 2661ad29dc..ef5a09f16a 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -30,10 +30,21 @@ Keep comments short and to the point: - Use tools to gather information rather than relying on assumptions - Examine existing code before making changes +- Grep for existing plumbing before adding a mechanism, and before calling + something unavailable - Validate all changes before considering tasks complete - Ask clarifying questions only when truly necessary - When possible, call independent tools concurrently — it's faster +### Client and Session Lifetimes + +- Provider clients are built per team load: once per session in `serve api`, + once at startup in `serve a2a` and `serve mcp` +- Anything that must vary per conversation belongs in a request middleware, + not in client construction +- The session ID is on the request context via + `httpclient.SessionIDFromContext`; `chatgptAuthMiddleware` shows the shape + ## Validation Requirements Before marking work as complete: @@ -48,6 +59,10 @@ Before marking work as complete: # Development Commands +Canonical setup, commands and style guide: +[the contributing guide](docs/community/contributing/index.md). The list below +is a quick reference. + ## Build and Development - `task build` — Build the application binary (outputs to `./bin/docker-agent`)