mirror of
https://github.com/coder/coder.git
synced 2026-06-03 04:58:23 +00:00
a852231a77
Add an Unimplemented stub for PushContextState so the binary satisfies the v2.10 DRPCAgentServer interface. The real handler that persists snapshots and fans dirty events out to chats lands with the chatd integration. Until then, agents receive Unimplemented and stop pushing for the connection (agentcontext.RunPush handles this gracefully).
31 lines
1.0 KiB
Go
31 lines
1.0 KiB
Go
package agentapi
|
|
|
|
import (
|
|
"context"
|
|
|
|
"storj.io/drpc/drpcerr"
|
|
|
|
agentproto "github.com/coder/coder/v2/agent/proto"
|
|
)
|
|
|
|
// PushContextState is the server-side stub for the v2.10
|
|
// PushContextState RPC. Coderd does not yet persist context
|
|
// snapshots; the chatd integration that consumes pushes lives
|
|
// in a follow-up change.
|
|
//
|
|
// Returning Unimplemented signals the agent to stop pushing for
|
|
// the remainder of the connection. The agent.Manager.RunPush
|
|
// loop translates this into a clean shutdown rather than a
|
|
// retry storm.
|
|
func (*API) PushContextState(_ context.Context, _ *agentproto.PushContextStateRequest) (*agentproto.PushContextStateResponse, error) {
|
|
return nil, drpcerr.WithCode(errPushContextStateUnimplemented, drpcerr.Unimplemented)
|
|
}
|
|
|
|
// errPushContextStateUnimplemented is the static error returned
|
|
// by PushContextState before the chatd integration lands.
|
|
var errPushContextStateUnimplemented = stringError("agentapi: PushContextState is not implemented yet")
|
|
|
|
type stringError string
|
|
|
|
func (e stringError) Error() string { return string(e) }
|