Documentation
¶
Overview ¶
Package session records what each agent session is currently doing.
This is scratch state, stored per working tree and never committed: it changes every few minutes and would swamp the history of a repository whose whole point is readable diffs. The consequence, stated plainly, is that a teammate on their own clone cannot see your session — there is no sync channel for it, by design.
Index ¶
- Constants
- func ClaimProcessAlive(ticketID, sessionID string) bool
- func DefaultID() string
- func ForgetClaimProcess(ticketID string) error
- func Path(s *ticket.Store, id string) string
- func RecordClaimProcess(ticketID, sessionID string) error
- func Remove(s *ticket.Store, id string) error
- func Save(s *ticket.Store, sess Session) error
- type Session
Constants ¶
const StaleAfter = 20 * time.Minute
StaleAfter is how long a session may go without a checkpoint before the board dims it. Sessions are never deleted automatically: a crashed session's last known focus is useful information, not garbage.
Variables ¶
This section is empty.
Functions ¶
func ClaimProcessAlive ¶ added in v0.5.7
ClaimProcessAlive reports whether the process recorded for ticketID belongs to sessionID and is still running on this machine. A recorded process name that no longer matches means the id was reused by something else.
func DefaultID ¶
func DefaultID() string
DefaultID prefers an identifier supplied by the harness, falling back to something stable for the shell so repeated calls update one record rather than littering the directory.
func ForgetClaimProcess ¶ added in v0.5.7
ForgetClaimProcess removes the note for ticketID, if there is one.
func RecordClaimProcess ¶ added in v0.5.7
RecordClaimProcess notes that sessionID's agent process holds ticketID. With no agent process to name it removes any older note instead, so a claim taken from a plain shell never inherits the liveness of an earlier one.
Types ¶
type Session ¶
type Session struct {
ID string `json:"id"`
TicketID string `json:"ticket_id,omitempty"`
Focus string `json:"focus"`
Reasoning string `json:"reasoning,omitempty"`
Model string `json:"model,omitempty"`
Host string `json:"host,omitempty"`
PID int `json:"pid,omitempty"`
UpdatedAt string `json:"updated_at"`
}
Session is one agent session's current focus.