chore(orchestrator): Wave 1 complete — fix merge conflicts, mark tasks done
All checks were successful
ci/woodpecker/pr/ci Pipeline was successful
ci/woodpecker/push/ci Pipeline was successful

Fix typecheck: addMessage/findById now require userId (from PR #293).
Mark M2-001/002/005/006 done. All Wave 1 tasks complete (9/65).
PRs #290, #292, #293, #294 merged. Issues #224-226, #232-237 closed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-21 15:35:28 -05:00
parent 05a805eeca
commit 6b0f789634
2 changed files with 24 additions and 18 deletions

View File

@@ -127,14 +127,17 @@ export class ChatGateway implements OnGatewayInit, OnGatewayConnection, OnGatewa
// Persist the user message
if (userId) {
try {
await this.brain.conversations.addMessage({
conversationId,
role: 'user',
content: data.content,
metadata: {
timestamp: new Date().toISOString(),
await this.brain.conversations.addMessage(
{
conversationId,
role: 'user',
content: data.content,
metadata: {
timestamp: new Date().toISOString(),
},
},
});
userId,
);
} catch (err) {
this.logger.error(
`Failed to persist user message for conversation=${conversationId}`,
@@ -257,7 +260,7 @@ export class ChatGateway implements OnGatewayInit, OnGatewayConnection, OnGatewa
*/
private async ensureConversation(conversationId: string, userId: string): Promise<void> {
try {
const existing = await this.brain.conversations.findById(conversationId);
const existing = await this.brain.conversations.findById(conversationId, userId);
if (!existing) {
await this.brain.conversations.create({
id: conversationId,
@@ -341,12 +344,15 @@ export class ChatGateway implements OnGatewayInit, OnGatewayConnection, OnGatewa
}
this.brain.conversations
.addMessage({
conversationId,
role: 'assistant',
content: cs.assistantText,
metadata,
})
.addMessage(
{
conversationId,
role: 'assistant',
content: cs.assistantText,
metadata,
},
userId,
)
.catch((err: unknown) => {
this.logger.error(
`Failed to persist assistant message for conversation=${conversationId}`,