Skip to content

Commit 4b5c21a

Browse files
committed
Merge the updated layer below into mike/chatd-turn-env-split/receiver-name
2 parents a81c685 + a641bf0 commit 4b5c21a

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

‎coderd/x/chatd/turn_environment_internal_test.go‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -708,6 +708,8 @@ func TestBuildTurnEnvironmentToolPolicy(t *testing.T) {
708708
seedAgentContext(ctx, t, db, agent.ID, "workspace", []byte("workspace"),
709709
database.WorkspaceAgentContextBodyKindMcpServer, workspaceMCPBody)
710710
parent := dbgen.Chat(t, db, database.Chat{OrganizationID: org.ID, OwnerID: user.ID, LastModelConfigID: modelConfig.ID})
711+
// Children load inline MCP servers from the root chat; this one does not allow sub-agents.
712+
dbgen.ChatMCPServer(t, db, database.ChatMCPServer{ChatID: parent.ID, Slug: "inline", Url: echoURL})
711713

712714
server := newInternalTestServer(t, db, ps, chatprovider.ProviderAPIKeys{},
713715
withInternalTestServerTransportFactory(&aibridgeTestFactory{}),
@@ -791,7 +793,7 @@ func TestBuildTurnEnvironmentToolPolicy(t *testing.T) {
791793
},
792794
dontWant: []string{
793795
"write_file", "edit_files", "spawn_agent", "wait_agent", "unselected__echo", "forced__echo",
794-
"workspace__echo",
796+
"inline__echo", "workspace__echo",
795797
},
796798
},
797799
{
@@ -840,7 +842,9 @@ func TestBuildTurnEnvironmentToolPolicy(t *testing.T) {
840842
}
841843
created, err := chatstate.CreateChat(ctx, db, ps, input)
842844
require.NoError(t, err)
843-
dbgen.ChatMCPServer(t, db, database.ChatMCPServer{ChatID: created.Chat.ID, Slug: "inline", Url: echoURL})
845+
if !tt.child {
846+
dbgen.ChatMCPServer(t, db, database.ChatMCPServer{ChatID: created.Chat.ID, Slug: "inline", Url: echoURL})
847+
}
844848

845849
chat, messages := created.Chat, created.InitialMessages
846850
if tt.replaceMCP {

0 commit comments

Comments
 (0)