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
fix: add flag to disable workspace agent context sync (cherry-pick #28522) (#28525)
Cherry-pick of #28522 (`26de6140fb`) onto `release/2.35`.
Adds `CODER_DISABLE_WORKSPACE_AGENT_CONTEXT_SYNC` /
`--disable-workspace-agent-context-sync`. When set, `PushContextState`
rejects agent context pushes with a dRPC `Unimplemented` code before any
validation or database work; deployed agents translate that into
`ErrPushUnimplemented` and stop their push loop for the life of the
connection. This gives large deployments a server-only kill switch for
context sync database write load, with no agent updates or workspace
restarts required.
Two conflicts resolved relative to the original commit:
- `coderd/workspaceagentsrpc.go`: `release/2.35` assigns
`ContextDirtyMarker: api.chatDaemon` directly (the nil-guarded local was
introduced later on `main`); kept the branch's form and added
`ContextSyncDisabled` alongside it.
- `docs/admin/setup/configuration-reference.md`: dropped; this generated
doc does not exist on `release/2.35`.
Validated on this branch: `go build`, `TestPushContextState` (unit),
`TestWorkspaceAgentPushContextState*` (end-to-end over real dRPC), CLI
and enterprise golden-file tests, full pre-commit hooks.
// The rejected push must not have persisted anything.
3288
+
_, err=db.GetLatestWorkspaceAgentContextSnapshot(dbauthz.AsSystemRestricted(ctx), agentID) //nolint:gocritic // Test assertions read agent-pushed rows directly from the store.
3289
+
require.ErrorIs(t, err, sql.ErrNoRows)
3290
+
}
3291
+
3243
3292
funcrequireGetManifest(ctx context.Context, t testing.TB, aAPI agentproto.DRPCAgentClient) agentsdk.Manifest {
Description: "Stop persisting workspace agent context snapshots (instructions, skills, and MCP state used for pinned chat context). When set, coderd rejects agent context pushes as unimplemented and agents stop sending them; chats cannot pin workspace context. Use this to shed the database write load of context sync on large deployments.",
Description: "The token expiry duration for browser sessions. Sessions may last longer if they are actively making requests, but this functionality can be disabled via --disable-session-expiry-refresh.",
0 commit comments