mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: add chat sharing foundation (#25041)
This commit is contained in:
@@ -721,7 +721,10 @@ func TestExploreSubagentIsReadOnly(t *testing.T) {
|
||||
require.True(t, requestHasSystemSubstring(childRequests[0], "You are in Explore Mode as a delegated sub-agent."))
|
||||
require.False(t, requestHasSystemSubstring(rootRequests[0], "You are in Explore Mode as a delegated sub-agent."))
|
||||
|
||||
rootChats, err := db.GetChats(dbauthz.AsChatd(ctx), database.GetChatsParams{OwnerID: user.UserID})
|
||||
rootChats, err := db.GetChats(dbauthz.AsChatd(ctx), database.GetChatsParams{
|
||||
OwnedOnly: true,
|
||||
ViewerID: user.UserID,
|
||||
})
|
||||
require.NoError(t, err)
|
||||
rootIDs := make([]uuid.UUID, 0, len(rootChats))
|
||||
for _, root := range rootChats {
|
||||
@@ -2362,7 +2365,8 @@ func TestCreateChatRejectsWhenUsageLimitReached(t *testing.T) {
|
||||
})
|
||||
|
||||
beforeChats, err := db.GetChats(ctx, database.GetChatsParams{
|
||||
OwnerID: user.ID,
|
||||
OwnedOnly: true,
|
||||
ViewerID: user.ID,
|
||||
AfterID: uuid.Nil,
|
||||
OffsetOpt: 0,
|
||||
LimitOpt: 100,
|
||||
@@ -2385,7 +2389,8 @@ func TestCreateChatRejectsWhenUsageLimitReached(t *testing.T) {
|
||||
require.Equal(t, int64(100), limitErr.ConsumedMicros)
|
||||
|
||||
afterChats, err := db.GetChats(ctx, database.GetChatsParams{
|
||||
OwnerID: user.ID,
|
||||
OwnedOnly: true,
|
||||
ViewerID: user.ID,
|
||||
AfterID: uuid.Nil,
|
||||
OffsetOpt: 0,
|
||||
LimitOpt: 100,
|
||||
|
||||
@@ -2005,7 +2005,8 @@ func TestSpawnAgent_ComputerUseRejectsMissingConfiguredProvider(t *testing.T) {
|
||||
ids := availableSubagentTypeIDs(ctx, server, parentChat)
|
||||
require.Contains(t, ids, subagentTypeComputerUse)
|
||||
beforeChats, err := db.GetChats(ctx, database.GetChatsParams{
|
||||
OwnerID: user.ID,
|
||||
OwnedOnly: true,
|
||||
ViewerID: user.ID,
|
||||
AfterID: uuid.Nil,
|
||||
OffsetOpt: 0,
|
||||
LimitOpt: 100,
|
||||
@@ -2021,7 +2022,8 @@ func TestSpawnAgent_ComputerUseRejectsMissingConfiguredProvider(t *testing.T) {
|
||||
require.Contains(t, resp.Content, "computer-use")
|
||||
require.Contains(t, resp.Content, "openai")
|
||||
afterChats, err := db.GetChats(ctx, database.GetChatsParams{
|
||||
OwnerID: user.ID,
|
||||
OwnedOnly: true,
|
||||
ViewerID: user.ID,
|
||||
AfterID: uuid.Nil,
|
||||
OffsetOpt: 0,
|
||||
LimitOpt: 100,
|
||||
|
||||
Reference in New Issue
Block a user