Skip to content

chore(atomic): implement MSW mock of agent api#7174

Draft
erocheleau wants to merge 8 commits intomainfrom
SFINT-6636
Draft

chore(atomic): implement MSW mock of agent api#7174
erocheleau wants to merge 8 commits intomainfrom
SFINT-6636

Conversation

@erocheleau
Copy link
Collaborator

@erocheleau erocheleau commented Feb 25, 2026

SFINT-6636

I've added a story and a mock to atomic-generated-answer whenever we're using an agent-id.

WIP

Screen Shot 2026-02-25 at 6 13 03 PM

Comment on lines +205 to +214
const latencyStream = new TransformStream({
start() {},
async transform(chunk, controller) {
const message = messages[messageIndex];
const delayMs = message?.delayMs ?? defaultDelay;
await delay(delayMs);
messageIndex++;
controller.enqueue(chunk);
},
});
@github-actions
Copy link

🔗 Scratch Orgs ready to test this PR:

Copy link
Contributor

@mmitiche mmitiche left a comment

Choose a reason for hiding this comment

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

couple comments on the payload of the events, but the setup looks good 👍

Comment on lines +43 to +44
threadId: THREAD_ID,
runId: RUN_ID,
Copy link
Contributor

Choose a reason for hiding this comment

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

These two will not be sent in all the events, they are included only in the RunStarted, RunFinished so I think you can make them optional as well like other properties.

type: EventType.CUSTOM,
name: 'header',
value: {
conversationId: THREAD_ID,
Copy link
Contributor

Choose a reason for hiding this comment

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

As par the latest discussion with KCORE, conversationId will no longer be sent in the header event, because it's already sent in the RunStarted event.

}),
// TODO: Citations will be handled separately
buildMessage({
type: EventType.RUN_FINISHED,
Copy link
Contributor

Choose a reason for hiding this comment

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

The run finished event also contains a property result, where the KGAS will send us the property answerGenerated: boolean

Comment on lines +184 to +185
: delayBetweenMessages === 'infinite'
? Number.POSITIVE_INFINITY
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we need the infinity ?

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants