Skip to content
Merged
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
7 changes: 1 addition & 6 deletions web/package-lock.json

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

23 changes: 10 additions & 13 deletions web/src/components/ReassignModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,15 @@ export default {
agents: {
type: Array,
required: true
},
isSubmitting: {
type: Boolean,
default: false
}
},
emits: ['close', 'reassign'],
setup(props, { emit }) {
const selectedAgentId = ref('')
const isSubmitting = ref(false)

// Filter out the currently assigned agent
const availableAgents = computed(() => {
Expand All @@ -81,26 +84,20 @@ export default {
}
})

const handleSubmit = async () => {
const handleSubmit = () => {
if (!selectedAgentId.value || !props.task) {
return
}

isSubmitting.value = true
try {
emit('reassign', {
taskId: props.task.id,
agentId: selectedAgentId.value
})
selectedAgentId.value = ''
} finally {
isSubmitting.value = false
}
emit('reassign', {
taskId: props.task.id,
agentId: selectedAgentId.value
})
selectedAgentId.value = ''

Copilot AI Jan 27, 2026

Copy link

Choose a reason for hiding this comment

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

The local form state is being reset immediately after emitting the reassign event, before the parent's async operation completes. This causes the selectedAgentId to clear while the modal is still visible (if an error occurs and the modal stays open).

The watch on props.show already resets selectedAgentId when the modal opens, so this line should be removed. Let the parent control when the modal closes, and the watch will naturally reset the form when it reopens.

Suggested change
selectedAgentId.value = ''

Copilot uses AI. Check for mistakes.
}

return {
selectedAgentId,
isSubmitting,
availableAgents,
handleSubmit
}
Expand Down
6 changes: 6 additions & 0 deletions web/src/views/ProjectDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@
:show="showReassignTaskModal"
:task="reassigningTask"
:agents="agents"
:is-submitting="isReassigningTask"
@close="showReassignTaskModal = false"
@reassign="handleReassignTask"
/>
Expand Down Expand Up @@ -346,6 +347,7 @@ export default {
const showAddAgentModal = ref(false)
const showAddTaskModal = ref(false)
const showReassignTaskModal = ref(false)
const isReassigningTask = ref(false)
const showAddContextModal = ref(false)
const showViewContextModal = ref(false)
const showDeleteConfirm = ref(false)
Expand Down Expand Up @@ -977,6 +979,7 @@ get_project_contexts() {
const handleReassignTask = async (reassignmentData) => {
if (!reassigningTask.value) return

isReassigningTask.value = true
try {
const response = await fetch(`/api/tasks/${reassignmentData.taskId}/reassign`, {
method: 'PUT',
Expand Down Expand Up @@ -1007,6 +1010,8 @@ get_project_contexts() {
} catch (error) {
console.error('Failed to reassign task:', error)
alert('Failed to reassign task. Please try again.')
} finally {
isReassigningTask.value = false
}
}

Expand Down Expand Up @@ -1348,6 +1353,7 @@ The mcp.json file includes:
showAddAgentModal,
showAddTaskModal,
showReassignTaskModal,
isReassigningTask,
showAddContextModal,
showViewContextModal,
showDeleteConfirm,
Expand Down