-
Notifications
You must be signed in to change notification settings - Fork 10
feat(agent): surface the run's artist_account_id in the agent system prompt #742
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -31,4 +31,17 @@ describe("buildAgentSystemPrompt", () => { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| expect(prompt).toMatch(/never fabricate/i); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| expect(prompt).toMatch(/sample|estimate|industry average/i); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| it("emits IMPORTANT CONTEXT VALUES when artistId/accountId are provided", () => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const prompt = buildAgentSystemPrompt({ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| artistId: "ebae4bb9-e38f-4763-b3c8-ff30e99f5d01", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| accountId: "fb678396-a68f-4294-ae50-b8cacf9ce77b", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| expect(prompt).toMatch(/IMPORTANT CONTEXT VALUES/); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| expect(prompt).toContain("artist_account_id: ebae4bb9-e38f-4763-b3c8-ff30e99f5d01"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| expect(prompt).toContain("account_id: fb678396-a68f-4294-ae50-b8cacf9ce77b"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+34
to
+42
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P3: The new prompt logic has separate Prompt for AI agents
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| it("omits the context section when neither artistId nor accountId is provided", () => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| expect(buildAgentSystemPrompt({})).not.toMatch(/IMPORTANT CONTEXT VALUES/); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2: The new
account_idprompt propagation is currently type-optional at therunAgentStepboundary, which weakens the compile-time guarantee that this context is always present. Since upstream workflow input already requiresaccountId, making it optional here can let future call sites accidentally omit it and silently removeaccount_idfrom the system prompt again. Keeping this field required inRunAgentStepInputwould preserve the end-to-end contract.Prompt for AI agents