( t *testing.T, mockConn *agentconnmock.MockAgentConn, storeFile chattool.StoreFileFunc, resolvePlanPath func(context.Context) (string, string, error), isPlanTurn ...bool, )
| 608 | } |
| 609 | |
| 610 | func 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 | |
| 632 | func fakeStoreFile(t *testing.T) (chattool.StoreFileFunc, *[]byte) { |
| 633 | t.Helper() |
no test coverage detected