steps

package
v0.1.16 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 26, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultExecuteTimeout = 2 * time.Hour

DefaultExecuteTimeout is the hard timeout for the runtime execution step.

View Source
const (
	ToolNameMemory = "memory"
)

Variables

This section is empty.

Functions

func NormalizeRequest

func NormalizeRequest(req *agent.RequestContext)

func ShouldRunLearningCheck

func ShouldRunLearningCheck(req *agent.RequestContext, result *agent.RunResult, trace *lifecyclejournal.RunTrace) bool

ShouldRunLearningCheck 根据运行结果和 trace 判断是否值得启动一次学习检查。

Types

type ArtifactBaselineStep

type ArtifactBaselineStep struct{}

ArtifactBaselineStep captures a file snapshot of the repo directory before agent execution. The baseline is written to the turn directory so that a later ArtifactReconcileStep can detect files created or modified during the run.

func (ArtifactBaselineStep) Name

func (ArtifactBaselineStep) Run

func (ArtifactBaselineStep) Run(ctx context.Context, state *State) error

type ArtifactReconcileStep

type ArtifactReconcileStep struct{}

ArtifactReconcileStep compares the current repo state against the baseline and populates the artifact manifest with any auto-detected file changes. It skips reconciliation when the manifest already contains final entries (explicitly declared artifacts take priority).

func (ArtifactReconcileStep) Name

func (ArtifactReconcileStep) Run

func (ArtifactReconcileStep) Run(ctx context.Context, state *State) error

type ArtifactRecorder

type ArtifactRecorder interface {
	Record(ctx context.Context, req *agent.RequestContext) ([]events.ArtifactPayload, error)
}

ArtifactRecorder 记录已声明的产物并返回公开的事件负载。

type ArtifactStep

type ArtifactStep struct {
	Recorder ArtifactRecorder
}

ArtifactStep 在终端运行事件发送前记录 manifest 中的产物。

func (ArtifactStep) Name

func (ArtifactStep) Name() string

func (ArtifactStep) Run

func (s ArtifactStep) Run(ctx context.Context, state *State) error

type AuthorizeStep

type AuthorizeStep struct{}

func (AuthorizeStep) Name

func (AuthorizeStep) Name() string

func (AuthorizeStep) Run

type ContextBuilder

type ContextBuilder interface {
	Prepare(ctx context.Context, req *agent.RequestContext) (*agent.RequestContext, error)
}

type ContextStep

type ContextStep struct {
	Builder ContextBuilder
}

func (ContextStep) Name

func (ContextStep) Name() string

func (ContextStep) Run

func (s ContextStep) Run(ctx context.Context, state *State) error

type ExecuteStep

type ExecuteStep struct {
	Delegate agent.Runner
}

func (ExecuteStep) Name

func (ExecuteStep) Name() string

func (ExecuteStep) Run

func (s ExecuteStep) Run(ctx context.Context, state *State) error

type JournalStep

type JournalStep struct{}

func (JournalStep) Name

func (JournalStep) Name() string

func (JournalStep) Run

func (JournalStep) Run(_ context.Context, state *State) error

type LearningService

type LearningService struct {
	Builder          ContextBuilder
	Delegate         agent.Runner
	ToolAvailability ToolAvailability
}

func (*LearningService) AfterRunLearning

func (s *LearningService) AfterRunLearning(ctx context.Context, req *agent.RequestContext, result *agent.RunResult, trace *lifecyclejournal.RunTrace) error

AfterRunLearning 在主任务完成后触发学习检查,让 agent 判断是否需要沉淀长期记忆或技能流程。

func (*LearningService) BeforeCompact

func (s *LearningService) BeforeCompact(ctx context.Context, req *agent.RequestContext) error

BeforeCompact 在上下文压缩前尝试刷新长期记忆,避免稳定偏好或项目事实随上下文丢失。

func (*LearningService) BeforeReset

func (s *LearningService) BeforeReset(ctx context.Context, req *agent.RequestContext) error

BeforeReset 在会话重置前尝试刷新长期记忆,保留后续会话仍有价值的信息。

type LearningStep

type LearningStep struct {
	Service *LearningService
}

func (LearningStep) Name

func (LearningStep) Name() string

func (LearningStep) Run

func (s LearningStep) Run(ctx context.Context, state *State) error

Run 执行生命周期学习步骤;学习失败只记录告警,不阻断主任务返回。

type ModelStep

type ModelStep struct{}

It writes the real upstream configuration to modelrouter store and modifies the request's BaseURL to use the built-in worker model proxy.

func (ModelStep) Name

func (ModelStep) Name() string

func (ModelStep) Run

func (s ModelStep) Run(ctx context.Context, state *State) error

type NormalizeStep

type NormalizeStep struct{}

func (NormalizeStep) Name

func (NormalizeStep) Name() string

func (NormalizeStep) Run

func (NormalizeStep) Run(_ context.Context, state *State) error

type PersistStep

type PersistStep struct{}

func (PersistStep) Name

func (PersistStep) Name() string

func (PersistStep) Run

func (PersistStep) Run(ctx context.Context, state *State) error

type Pipeline

type Pipeline []Step

func (Pipeline) Run

func (p Pipeline) Run(ctx context.Context, state *State) error

type PushWorkspaceStep added in v0.1.14

type PushWorkspaceStep struct{}

func (PushWorkspaceStep) Name added in v0.1.14

func (PushWorkspaceStep) Name() string

func (PushWorkspaceStep) Run added in v0.1.14

func (s PushWorkspaceStep) Run(ctx context.Context, state *State) error

type SessionCompleteStep

type SessionCompleteStep struct {
	Provider lifecyclecontext.SessionMessageProvider
}

func (SessionCompleteStep) Name

func (SessionCompleteStep) Name() string

func (SessionCompleteStep) Run

func (s SessionCompleteStep) Run(ctx context.Context, state *State) error

type StartEventStep

type StartEventStep struct{}

func (StartEventStep) Name

func (StartEventStep) Name() string

func (StartEventStep) Run

func (StartEventStep) Run(ctx context.Context, state *State) error

type State

type State struct {
	OriginalRequest *agent.RequestContext
	Request         *agent.RequestContext
	Journal         *lifecyclejournal.RunJournal
	Result          *agent.RunResult
	Err             error
	StartedAt       time.Time
	Skipped         bool
}

type Step

type Step interface {
	Name() string
	Run(ctx context.Context, state *State) error
}

type ToolAvailability

type ToolAvailability interface {
	AvailableToolNames(names []string) []string
}

type WorkspaceArtifactRecorder

type WorkspaceArtifactRecorder struct{}

WorkspaceArtifactRecorder 收集运行工作区 manifest 中声明的产物。

func NewWorkspaceArtifactRecorder

func NewWorkspaceArtifactRecorder() *WorkspaceArtifactRecorder

NewWorkspaceArtifactRecorder 创建基于 manifest 的产物记录器。

func (*WorkspaceArtifactRecorder) Record

Record 收集单次运行的最终 manifest 产物。

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL