Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions apps/worker/src/callbacks/__tests__/linear-agent.test.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

51 changes: 51 additions & 0 deletions apps/worker/src/callbacks/__tests__/request-user-input.test.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

187 changes: 164 additions & 23 deletions apps/worker/src/callbacks/__tests__/slack-mention.test.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions apps/worker/src/callbacks/linear-agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
formatRequestUserInputPrompt,
getRequestUserInputPromptSignature,
isSingleQuestionRequestUserInput,
isStreamingPlaceholderRequestUserInput,
supportsIntegrationRequestUserInput,
} from './request-user-input';

Expand Down Expand Up @@ -265,6 +266,10 @@ export const linearAgentCallbacks: RunTaskCallbacks = {
return;
}

if (isStreamingPlaceholderRequestUserInput(event.request)) {
return;
}

try {
if (!supportsIntegrationRequestUserInput(event.request)) {
const taskUrl = buildRequestUserInputTaskUrl(taskRun, 'linear');
Expand Down
20 changes: 20 additions & 0 deletions apps/worker/src/callbacks/request-user-input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,26 @@ export function getRequestUserInputPromptSignature(
});
}

export const STREAMING_PLACEHOLDER_QUESTION_TEXT =
'Provide the requested input.';

export function isStreamingPlaceholderRequestUserInput(
request: Pick<AcpRequestUserInputPayload, 'questions'>,
): boolean {
if (request.questions.length !== 1) {
return false;
}

const question = request.questions[0]!;
const hasNoOptions = !question.options || question.options.length === 0;

return (
hasNoOptions &&
question.id === 'response' &&
question.question === STREAMING_PLACEHOLDER_QUESTION_TEXT
);
}

export function isSingleQuestionRequestUserInput(
request: AcpRequestUserInputPayload,
): boolean {
Expand Down
Loading
Loading