Repository navigation
Separate user conversation from agent coordination #25429
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
c043250
abbd173
ab6007c
9219d1c
4ffd83b
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 | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -156,6 +156,9 @@ export function NewTaskDraftScreen(props: { | |||||||||||||||||||||||||||
| const [creationMetadata] = useState(makeTurnCommandMetadata); | ||||||||||||||||||||||||||||
| const projects = useProjects(); | ||||||||||||||||||||||||||||
| const flow = useNewTaskFlow(); | ||||||||||||||||||||||||||||
| const [communicationLanesOptIn, setCommunicationLanesOptIn] = useState( | ||||||||||||||||||||||||||||
| flow.editingPendingTask?.creation?.communicationLanesEnabled === true, | ||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||
|
Comment on lines
+159
to
+161
Contributor
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. 🔎 Supported by static analysis
Seed the coordination opt-in from the edited pending task.
On send, lines 950-952 add 🐛 Suggested fix
Committable suggestion
|
||||||||||||||||||||||||||||
| const navigation = useNavigation(); | ||||||||||||||||||||||||||||
| const goBack = useWorkspaceBackNavigation("threads"); | ||||||||||||||||||||||||||||
| const { | ||||||||||||||||||||||||||||
|
|
@@ -183,6 +186,13 @@ export function NewTaskDraftScreen(props: { | |||||||||||||||||||||||||||
| const selectedEnvironmentServerConfig = useEnvironmentServerConfig( | ||||||||||||||||||||||||||||
| selectedProject?.environmentId ?? null, | ||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||
| const supportsCommunicationLanes = | ||||||||||||||||||||||||||||
| selectedEnvironmentServerConfig?.environment.capabilities.communicationLanes === true && | ||||||||||||||||||||||||||||
| selectedEnvironmentServerConfig.providers.some( | ||||||||||||||||||||||||||||
| (provider) => | ||||||||||||||||||||||||||||
| provider.instanceId === flow.selectedModel?.instanceId && | ||||||||||||||||||||||||||||
| provider.communicationLanes === true, | ||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||
| const environmentConnected = connectionState === "connected"; | ||||||||||||||||||||||||||||
| const canOperate = useEnvironmentScope( | ||||||||||||||||||||||||||||
| selectedProject?.environmentId ?? null, | ||||||||||||||||||||||||||||
|
|
@@ -913,12 +923,36 @@ export function NewTaskDraftScreen(props: { | |||||||||||||||||||||||||||
| const message = flow.buildPendingTaskMessage(metadata, { | ||||||||||||||||||||||||||||
| currentCheckoutBranch: queuesInsteadOfStarting ? null : flow.currentCheckoutBranchName, | ||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||
| if (!message) { | ||||||||||||||||||||||||||||
| const creation = message?.creation; | ||||||||||||||||||||||||||||
| if (!message || !creation) { | ||||||||||||||||||||||||||||
| return null; | ||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
| const selectedProviderSupportsCommunicationLanes = | ||||||||||||||||||||||||||||
| selectedEnvironmentServerConfig?.environment.capabilities.communicationLanes === true && | ||||||||||||||||||||||||||||
| selectedEnvironmentServerConfig.providers.some( | ||||||||||||||||||||||||||||
| (provider) => | ||||||||||||||||||||||||||||
| provider.instanceId === modelSelection.instanceId && provider.communicationLanes === true, | ||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||
| if (communicationLanesOptIn && !selectedProviderSupportsCommunicationLanes) { | ||||||||||||||||||||||||||||
| Dialog.alert( | ||||||||||||||||||||||||||||
| "Agent messages can't be separated", | ||||||||||||||||||||||||||||
| "The selected provider can't keep agent-to-agent messages in the work log. Choose another provider or turn the switch off.", | ||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||
| return null; | ||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
| // Persist locally before clearing or leaving the draft; server setup runs on the thread. | ||||||||||||||||||||||||||||
| flow.setSubmitting(true); | ||||||||||||||||||||||||||||
| const queued = await settlePromise(() => enqueueThreadOutboxMessage(message)); | ||||||||||||||||||||||||||||
| const queued = await settlePromise(() => | ||||||||||||||||||||||||||||
| enqueueThreadOutboxMessage({ | ||||||||||||||||||||||||||||
| ...message, | ||||||||||||||||||||||||||||
| creation: { | ||||||||||||||||||||||||||||
| ...creation, | ||||||||||||||||||||||||||||
| ...(selectedProviderSupportsCommunicationLanes && communicationLanesOptIn | ||||||||||||||||||||||||||||
| ? { communicationLanesEnabled: true } | ||||||||||||||||||||||||||||
| : {}), | ||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||
| }), | ||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||
| flow.setSubmitting(false); | ||||||||||||||||||||||||||||
| if (AsyncResult.isFailure(queued)) { | ||||||||||||||||||||||||||||
| const error = squashAtomCommandFailure(queued); | ||||||||||||||||||||||||||||
|
|
@@ -1186,6 +1220,16 @@ export function NewTaskDraftScreen(props: { | |||||||||||||||||||||||||||
| </View> | ||||||||||||||||||||||||||||
| ) : null} | ||||||||||||||||||||||||||||
| {flow.canChooseWorkspace ? workspaceControls : null} | ||||||||||||||||||||||||||||
| {supportsCommunicationLanes ? ( | ||||||||||||||||||||||||||||
|
Contributor
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. 🟠 High After opting in, switching to a provider or environment without lane support hides the only toggle but leaves
Suggested change
🤖 Copy this AI Prompt to have your agent fix this: |
||||||||||||||||||||||||||||
| <ComposerInlineControl | ||||||||||||||||||||||||||||
| accessibilityLabel="Keep agent-to-agent messages in the work log" | ||||||||||||||||||||||||||||
| label={`Agent messages: ${communicationLanesOptIn ? "Work log" : "Chat"}`} | ||||||||||||||||||||||||||||
| selected={communicationLanesOptIn} | ||||||||||||||||||||||||||||
| disabled={isComposerInteractionLocked} | ||||||||||||||||||||||||||||
| showChevron={false} | ||||||||||||||||||||||||||||
| onPress={() => setCommunicationLanesOptIn((enabled) => !enabled)} | ||||||||||||||||||||||||||||
| /> | ||||||||||||||||||||||||||||
| ) : null} | ||||||||||||||||||||||||||||
| </View> | ||||||||||||||||||||||||||||
| ), | ||||||||||||||||||||||||||||
| editorRef: promptInputRef, | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -198,7 +198,13 @@ export function ThreadQueueSheet({ route }: StaticScreenProps<QueueTarget>) { | |||||||||||||||||
| if (busyRef.current) return; | ||||||||||||||||||
| busyRef.current = true; | ||||||||||||||||||
| setResuming(true); | ||||||||||||||||||
| await resume({ ...target, input: { threadId: target.threadId } }); | ||||||||||||||||||
| const heldRun = queuedRuns.find(({ run }) => run.queueHeld === true); | ||||||||||||||||||
| if (heldRun) { | ||||||||||||||||||
| await resume({ | ||||||||||||||||||
| ...target, | ||||||||||||||||||
| input: { threadId: target.threadId, runId: heldRun.run.id }, | ||||||||||||||||||
| }); | ||||||||||||||||||
| } | ||||||||||||||||||
|
Comment on lines
+201
to
+207
Contributor
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. 🟠 High When a held message coexists with an active recovery continuation, pressing “Resume queue” fails instead of releasing the queue to drain after the active run. Passing
Suggested change
🤖 Copy this AI Prompt to have your agent fix this:
Comment on lines
+201
to
+207
Contributor
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. 🔎 Supported by static analysis
Preserve This sheet always sends a run ID, so Pass the lane flag to this sheet and include
|
||||||||||||||||||
| busyRef.current = false; | ||||||||||||||||||
| setResuming(false); | ||||||||||||||||||
| }} | ||||||||||||||||||
|
|
||||||||||||||||||
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.
🟠 High
threads/NewTaskDraftScreen.tsx:159Opening a queued task with
communicationLanesEnabled: trueleaves coordination lanes off, so saving it drops the flag unless the user toggles it back on. This initializer runs beforebeginEditingPendingTaskpopulateseditingPendingTask, and the rebuilt creation does not preserve the flag; initialize the opt-in after the pending-task snapshot loads.🤖 Copy this AI Prompt to have your agent fix this: