MCPcopy Index your code
hub / github.com/coder/coder / newProposePlanToolWithPlanPath

Function newProposePlanToolWithPlanPath

coderd/x/chatd/chattool/proposeplan_test.go:610–630  ·  view source on GitHub ↗
(
	t *testing.T,
	mockConn *agentconnmock.MockAgentConn,
	storeFile chattool.StoreFileFunc,
	resolvePlanPath func(context.Context) (string, string, error),
	isPlanTurn ...bool,
)

Source from the content-addressed store, hash-verified

608}
609
610func newProposePlanToolWithPlanPath(
611 t *testing.T,
612 mockConn *agentconnmock.MockAgentConn,
613 storeFile chattool.StoreFileFunc,
614 resolvePlanPath func(context.Context) (string, string, error),
615 isPlanTurn ...bool,
616) fantasy.AgentTool {
617 t.Helper()
618 enabled := false
619 if len(isPlanTurn) > 0 {
620 enabled = isPlanTurn[0]
621 }
622 return chattool.ProposePlan(chattool.ProposePlanOptions{
623 GetWorkspaceConn: func(_ context.Context) (workspacesdk.AgentConn, error) {
624 return mockConn, nil
625 },
626 ResolvePlanPath: resolvePlanPath,
627 StoreFile: storeFile,
628 IsPlanTurn: enabled,
629 })
630}
631
632func fakeStoreFile(t *testing.T) (chattool.StoreFileFunc, *[]byte) {
633 t.Helper()

Callers 2

TestProposePlanFunction · 0.85
newProposePlanToolFunction · 0.85

Calls 2

ProposePlanFunction · 0.92
HelperMethod · 0.65

Tested by

no test coverage detected