fix: thread allowEmptySubmit through submit pipeline
submitAgentInput returned "noop" for empty messages regardless of allowEmptySubmit, breaking the new-workspace empty-submit flow. Now the flag is passed from Composer through to submitAgentInput so empty submissions are allowed when the prop is set.
This commit is contained in:
@@ -3,6 +3,7 @@ export type AgentInputSubmitResult = "noop" | "queued" | "submitted" | "failed";
|
|||||||
export interface AgentInputSubmitActionInput<TImage> {
|
export interface AgentInputSubmitActionInput<TImage> {
|
||||||
message: string;
|
message: string;
|
||||||
imageAttachments?: TImage[];
|
imageAttachments?: TImage[];
|
||||||
|
allowEmptySubmit?: boolean;
|
||||||
forceSend?: boolean;
|
forceSend?: boolean;
|
||||||
isAgentRunning: boolean;
|
isAgentRunning: boolean;
|
||||||
canSubmit: boolean;
|
canSubmit: boolean;
|
||||||
@@ -22,7 +23,7 @@ export async function submitAgentInput<TImage>(
|
|||||||
const trimmedMessage = input.message.trim();
|
const trimmedMessage = input.message.trim();
|
||||||
const imageAttachments = input.imageAttachments;
|
const imageAttachments = input.imageAttachments;
|
||||||
|
|
||||||
if (!trimmedMessage && !imageAttachments?.length) {
|
if (!trimmedMessage && !imageAttachments?.length && !input.allowEmptySubmit) {
|
||||||
return "noop";
|
return "noop";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -354,6 +354,7 @@ export function Composer({
|
|||||||
await submitAgentInput({
|
await submitAgentInput({
|
||||||
message,
|
message,
|
||||||
imageAttachments,
|
imageAttachments,
|
||||||
|
allowEmptySubmit,
|
||||||
forceSend,
|
forceSend,
|
||||||
isAgentRunning: agentState.status === "running",
|
isAgentRunning: agentState.status === "running",
|
||||||
// Parent-managed submits are still valid submit paths even when the
|
// Parent-managed submits are still valid submit paths even when the
|
||||||
|
|||||||
Reference in New Issue
Block a user