( ctx context.Context, chatSnapshot database.Chat, buildID uuid.UUID, agentID uuid.UUID, )
| 732 | } |
| 733 | |
| 734 | func (c *turnWorkspaceContext) persistBuildAgentBinding( |
| 735 | ctx context.Context, |
| 736 | chatSnapshot database.Chat, |
| 737 | buildID uuid.UUID, |
| 738 | agentID uuid.UUID, |
| 739 | ) (database.Chat, error) { |
| 740 | updatedChat, err := c.server.db.UpdateChatBuildAgentBinding( |
| 741 | ctx, |
| 742 | database.UpdateChatBuildAgentBindingParams{ |
| 743 | ID: chatSnapshot.ID, |
| 744 | BuildID: uuid.NullUUID{ |
| 745 | UUID: buildID, |
| 746 | Valid: true, |
| 747 | }, |
| 748 | AgentID: uuid.NullUUID{ |
| 749 | UUID: agentID, |
| 750 | Valid: true, |
| 751 | }, |
| 752 | }, |
| 753 | ) |
| 754 | if err != nil { |
| 755 | return chatSnapshot, xerrors.Errorf( |
| 756 | "update chat build/agent binding: %w", err, |
| 757 | ) |
| 758 | } |
| 759 | c.setCurrentChat(updatedChat) |
| 760 | return updatedChat, nil |
| 761 | } |
| 762 | |
| 763 | func (c *turnWorkspaceContext) getWorkspaceAgent(ctx context.Context) (database.WorkspaceAgent, error) { |
| 764 | _, agent, err := c.ensureWorkspaceAgent(ctx) |
no test coverage detected