Skip to content

AgentClaim

An AgentClaim is a durable seat for one kagent Agent.

In kagent, an Agent is a definition. Each conversation with it is a Session: kagent creates a Session on demand, pins it to the Agent revision that was latest at that moment, and deletes it after it has been idle for the configured time. A Session is not a Kubernetes resource and has no name.

An AgentClaim gives one Session a stable identity in Kubernetes. Work addressed to the claim reaches the same conversation for as long as that Session lives, and when the Session is lost the claim binds to another, so the seat itself never goes away.

apiVersion: kslip.dev/v1alpha1
kind: AgentClaim
metadata:
name: builder
namespace: team-a
spec:
agentRef:
name: builder
rebindPolicy: Always
Terminal window
$ kubectl get agentclaims --namespace team-a
NAME AGENT PHASE SESSION AGE
builder builder Bound 0193e3c2-6f2e-7c5a-9b1d-4d2f8a6c1e77 2m
Field Description
agentRef.name The kagent Agent, in the claim’s namespace, that fills the seat. Immutable: a seat for another Agent is another claim.
rebindPolicy When the claim replaces its Session. Always, the default, replaces it when it is lost and when the Agent compiles another revision. OnLoss replaces it only when it is lost.
resetPolicy When the claim replaces its Session after an Assignment completes. Never, the default, keeps the Session across Assignments. OnFailure replaces the Session after a failed or canceled Assignment. AfterAssignment replaces the Session after every completed Assignment.
Field Description
phase Bound while the claim has a Session that accepts work, Pending otherwise.
session.id The bound Session. It is also the A2A context ID of the seat’s conversation.
activeAssignment The admitted Assignment and the Session it reserves.
resetSessionID The bound Session queued for replacement under resetPolicy. New Assignments wait until replacement completes.
session.revision The Agent revision the Session pins.
session.agentUID The UID the Agent had when the Session was requested.
bindings How many Sessions the claim has requested.
conditions Bound and RevisionCurrent, described below.

Bound is True while the claim has a Session that accepts work.

Reason Status Meaning
SessionReady True The Session accepts work.
AgentNotFound False The referenced Agent does not exist.
AgentNotReady False The Agent has no successful revision to run.
SessionCreating False kagent is creating the Session.
SessionRecovering False The Session’s runtime crashed and is being restored to its last snapshot.
SessionLost False The Session is gone or beyond recovery, and the claim is replacing it.
KagentUnavailable False A call to kagent failed and is retried.
KagentAccessDenied False kagent rejected kslip’s credentials.

RevisionCurrent is True while the Session pins the Agent’s latest successful revision.

Reason Status Meaning
RevisionCurrent True The Session pins the latest successful revision.
RevisionPinned False The Session pins another revision, and rebindPolicy: OnLoss keeps it there.
RebindWaitingForIdle False The Session pins another revision and is replaced once its active turn and any admitted Assignment end.
Unbound Unknown The claim has no Session to compare.
AgentNotFound, AgentNotReady Unknown The Agent does not exist or reports no successful revision.

A claim binds as soon as its Agent has a successful revision. kslip asks kagent for a Session, records it in status.session, and sets the phase to Bound. A claim created before its Agent stays Pending and binds when the Agent is ready.

When a Session’s runtime crashes, kslip asks kagent to restore it to its last snapshot. The claim keeps the same Session and its conversation. Work that was in flight at the crash is lost.

A claim replaces its Session when the Session is lost:

  • it was deleted, including by kagent’s idle expiration;
  • it failed and no operation restores it;
  • its runtime crashed beyond recovery;
  • its Agent was deleted and created again.

With rebindPolicy: Always, a claim also replaces its Session when the Agent compiles a revision other than the one the Session pins. With resetPolicy: OnFailure or AfterAssignment, a claim replaces its Session after a matching Assignment finishes, blocking new admissions until the fresh Session binds.

A replacement Session starts an empty conversation. The conversation, and the files in the runtime of the Session it replaces, are deleted with that Session.

kagent keeps a Session on the revision it was created with. Editing an Agent therefore changes nothing for a bound seat until the seat rebinds.

  • Always rebinds the seat to the latest revision. kslip waits until the Session has no active turn or admitted Assignment. An admitted Assignment keeps its Session while waiting for a reply. Queued Assignments use the Session that is bound when they are admitted.
  • OnLoss leaves the seat on its revision. RevisionCurrent reports the difference. A replacement for a lost Session uses the latest revision.

Deleting a claim deletes its Session, ending any active turn. The claim carries the kslip.dev/session finalizer until kagent confirms the deletion, so it remains while kagent is unreachable.

Deleting a claim and creating it again is the way to reset a seat to an empty conversation. An AgentSet creates a deleted claim again by itself.

A seat is addressed over A2A, at its Agent’s endpoint in kagent, with status.session.id as the context ID.

kagent accepts messages for a Session only from the identity that created it. For every claim that identity is the one kslip presents to kagent, described in the installation guide.

Reason Type Published when
Bound Normal The claim binds to a Session.
Rebinding Normal or Warning The claim replaces its Session. Normal for a revision change, Warning for a loss.
SessionRecovered Normal A crashed Session is restored.
KagentUnavailable Warning A call to kagent fails.
KagentAccessDenied Warning kagent rejects kslip’s credentials.

The binding architecture explains how the controller implements this.