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

Function TestStopAfterPlanTools

coderd/x/chatd/chatd_internal_test.go:621–648  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

619}
620
621func TestStopAfterPlanTools(t *testing.T) {
622 t.Parallel()
623
624 planMode := database.NullChatPlanMode{
625 ChatPlanMode: database.ChatPlanModePlan,
626 Valid: true,
627 }
628
629 t.Run("NormalModeReturnsNil", func(t *testing.T) {
630 t.Parallel()
631 require.Nil(t, stopAfterPlanTools(database.NullChatPlanMode{}, uuid.NullUUID{}))
632 })
633
634 t.Run("RootPlanModeIncludesClarificationTool", func(t *testing.T) {
635 t.Parallel()
636 require.Equal(t, map[string]struct{}{
637 "propose_plan": {},
638 "ask_user_question": {},
639 }, stopAfterPlanTools(planMode, uuid.NullUUID{}))
640 })
641
642 t.Run("ChildPlanModeSkipsClarificationTool", func(t *testing.T) {
643 t.Parallel()
644 require.Equal(t, map[string]struct{}{
645 "propose_plan": {},
646 }, stopAfterPlanTools(planMode, uuid.NullUUID{UUID: uuid.New(), Valid: true}))
647 })
648}
649
650func TestStopAfterBehaviorTools(t *testing.T) {
651 t.Parallel()

Callers

nothing calls this directly

Calls 4

stopAfterPlanToolsFunction · 0.85
RunMethod · 0.65
NewMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected