Skip to content

Created a SPEC to implement bg agents using pg-boss library#551

Draft
MatLBS wants to merge 1 commit intogetnao:mainfrom
MatLBS:feat/bg_agents
Draft

Created a SPEC to implement bg agents using pg-boss library#551
MatLBS wants to merge 1 commit intogetnao:mainfrom
MatLBS:feat/bg_agents

Conversation

@MatLBS
Copy link
Copy Markdown
Contributor

@MatLBS MatLBS commented Apr 2, 2026

Created a first spec to implements backgrounds agents in nao to handle cron jobs or triggers

I used pg-boss : https://timgit.github.io/pg-boss/#/

@MatLBS MatLBS marked this pull request as draft April 2, 2026 09:30
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 2, 2026

🚀 Preview Deployment

URL https://pr-551-cf86964.preview.getnao.io
Commit cf86964

⚠️ No LLM API keys configured - you'll see the API key setup flow when trying to chat.


Preview will be automatically removed when this PR is closed.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 1 file

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="spec-architecture-background-agents.md">

<violation number="1" location="spec-architecture-background-agents.md:177">
P2: The spec gives conflicting guidance on whether `saveAgentResult` should pass `finishReason` or `stopReason` to `chatQueries.upsertMessage`. REQ-009 says `finishReason`, but the example call uses `stopReason`. This inconsistency can lead to incorrect payloads during implementation.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.


Calls:

1. `chatQueries.upsertMessage({ role: 'assistant', chatId: chat.id, parts: [...], stopReason: result.finishReason, tokenUsage: result.usage, llmProvider: modelSelection.provider, llmModelId: modelSelection.modelId })`
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: The spec gives conflicting guidance on whether saveAgentResult should pass finishReason or stopReason to chatQueries.upsertMessage. REQ-009 says finishReason, but the example call uses stopReason. This inconsistency can lead to incorrect payloads during implementation.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At spec-architecture-background-agents.md, line 177:

<comment>The spec gives conflicting guidance on whether `saveAgentResult` should pass `finishReason` or `stopReason` to `chatQueries.upsertMessage`. REQ-009 says `finishReason`, but the example call uses `stopReason`. This inconsistency can lead to incorrect payloads during implementation.</comment>

<file context>
@@ -0,0 +1,465 @@
+
+Calls:
+
+1. `chatQueries.upsertMessage({ role: 'assistant', chatId: chat.id, parts: [...], stopReason: result.finishReason, tokenUsage: result.usage, llmProvider: modelSelection.provider, llmModelId: modelSelection.modelId })`
+2. `memoryService.safeScheduleMemoryExtraction({ userId: chat.userId, projectId: chat.projectId, chatId: chat.id, messages: uiMessages, provider: modelSelection.provider })`
+
</file context>
Fix with Cubic

@Bl3f
Copy link
Copy Markdown
Contributor

Bl3f commented Apr 2, 2026

Awesome thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants