Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(cfg Config, deps Deps) (agentkit.HookProvider, error)
New registers hook/before-step: Run compaction services before each model step; contributes /compact.
Best practices:
- Attach the same services here and to the agent's compaction dep: this hook covers the periodic check, the agent covers overflow recovery.
func NewTurnContinue ¶
func NewTurnContinue(cfg TurnContinueConfig, deps TurnContinueDeps) (agentkit.HookProvider, error)
NewTurnContinue registers hook/turn-continue: Decide whether an autonomous turn continues or stops; contributes /status.
Best practices:
- Useless without tool/todo and tool/finish: with no completion signal it can only stop on budget or stall.
- Decision order is finish, then stall, then budget, then segment limit, then pending work.
Types ¶
type Config ¶
type Config struct {
// ContributeCommands registers /compact on the shared commands registry.
// Only one hook/before-step instance should enable this (typically the default agent).
ContributeCommands bool `json:"contributeCommands"`
}
type Deps ¶
type Deps struct {
Services []compaction.Service `json:"services"`
SessionStore agentkit.SessionStore `json:"sessionStore"`
}
type TurnContinueConfig ¶
type TurnContinueConfig struct {
// MaxContinuations is segments this hook will ask for. The agent's budget.maxContinuations is the hard ceiling and always wins.
MaxContinuations int `json:"maxContinuations"`
// ContinuePrompt is text injected to start another segment.
ContinuePrompt string `json:"continuePrompt"`
// WrapUpPrompt is injected instead of ContinuePrompt once the budget is softly exhausted.
WrapUpPrompt string `json:"wrapUpPrompt"`
// RequireFinish keeps going until tool/finish is called, even with no pending todos.
RequireFinish *bool `json:"requireFinish"`
// RequireTodosDone keeps going while todos are still pending.
RequireTodosDone *bool `json:"requireTodosDone"`
// StallLimit stops after this many repeats of the same tool call signature.
StallLimit int `json:"stallLimit"`
}
type TurnContinueDeps ¶
type TurnContinueDeps struct {
SessionStore agentkit.SessionStore `json:"sessionStore"`
}
Click to show internal directories.
Click to hide internal directories.