@@ -115,28 +115,14 @@ public AgentEmitter(RequestContext context, EventQueue eventQueue) {
115115 this .contextId = context .getContextId ();
116116 }
117117
118- private void updateStatus (TaskState taskState ) {
119- updateStatus (taskState , null , taskState .isFinal ());
120- }
121-
122118 /**
123119 * Updates the task status to the given state with an optional message.
124120 *
125121 * @param taskState the new task state
126122 * @param message optional message to include with the status update
127123 */
128124 public void updateStatus (TaskState taskState , @ Nullable Message message ) {
129- updateStatus (taskState , message , taskState .isFinal ());
130- }
131-
132- /**
133- * Updates the task status to the given state with an optional message and finality flag.
134- *
135- * @param state the new task state
136- * @param message optional message to include with the status update
137- * @param isFinal whether this is a final status (prevents further updates)
138- */
139- private void updateStatus (TaskState state , @ Nullable Message message , boolean isFinal ) {
125+ boolean isFinal = taskState .isFinal ();
140126 // Check terminal state first (fail fast)
141127 if (terminalStateReached .get ()) {
142128 throw new IllegalStateException ("Cannot update task status - terminal state already reached" );
@@ -152,7 +138,7 @@ private void updateStatus(TaskState state, @Nullable Message message, boolean is
152138 TaskStatusUpdateEvent event = TaskStatusUpdateEvent .builder ()
153139 .taskId (taskId )
154140 .contextId (contextId )
155- .status (new TaskStatus (state , message , null ))
141+ .status (new TaskStatus (taskState , message , null ))
156142 .build ();
157143 eventQueue .enqueueEvent (event );
158144 }
@@ -371,7 +357,7 @@ public void reject(@Nullable Message message) {
371357 * Marks the task as INPUT_REQUIRED, indicating the agent needs user input to continue.
372358 */
373359 public void requiresInput () {
374- requiresInput (null , false );
360+ requiresInput (null );
375361 }
376362
377363 /**
@@ -380,33 +366,39 @@ public void requiresInput() {
380366 * @param message optional message to include
381367 */
382368 public void requiresInput (@ Nullable Message message ) {
383- requiresInput ( message , false );
369+ updateStatus ( TaskState . TASK_STATE_INPUT_REQUIRED , message );
384370 }
385371
386372 /**
387- * Marks the task as INPUT_REQUIRED with a finality flag .
373+ * Marks the task as INPUT_REQUIRED.
388374 *
389- * @param isFinal whether this is a final status (prevents further updates)
375+ * @param isFinal ignored — interrupted states are not final per the A2A specification.
376+ * Use {@link #requiresInput()} instead.
377+ * @deprecated The {@code isFinal} parameter has no effect. Use {@link #requiresInput()} instead.
390378 */
379+ @ Deprecated (forRemoval = true )
391380 public void requiresInput (boolean isFinal ) {
392- requiresInput (null , isFinal );
381+ requiresInput ();
393382 }
394383
395384 /**
396- * Marks the task as INPUT_REQUIRED with an optional message and finality flag .
385+ * Marks the task as INPUT_REQUIRED with an optional message.
397386 *
398387 * @param message optional message to include
399- * @param isFinal whether this is a final status (prevents further updates)
388+ * @param isFinal ignored — interrupted states are not final per the A2A specification.
389+ * Use {@link #requiresInput(Message)} instead.
390+ * @deprecated The {@code isFinal} parameter has no effect. Use {@link #requiresInput(Message)} instead.
400391 */
392+ @ Deprecated (forRemoval = true )
401393 public void requiresInput (@ Nullable Message message , boolean isFinal ) {
402- updateStatus ( TaskState . TASK_STATE_INPUT_REQUIRED , message , isFinal );
394+ requiresInput ( message );
403395 }
404396
405397 /**
406398 * Marks the task as AUTH_REQUIRED, indicating the agent needs authentication to continue.
407399 */
408400 public void requiresAuth () {
409- requiresAuth (null , false );
401+ requiresAuth (null );
410402 }
411403
412404 /**
@@ -415,26 +407,32 @@ public void requiresAuth() {
415407 * @param message optional message to include
416408 */
417409 public void requiresAuth (@ Nullable Message message ) {
418- requiresAuth ( message , false );
410+ updateStatus ( TaskState . TASK_STATE_AUTH_REQUIRED , message );
419411 }
420412
421413 /**
422- * Marks the task as AUTH_REQUIRED with a finality flag .
414+ * Marks the task as AUTH_REQUIRED.
423415 *
424- * @param isFinal whether this is a final status (prevents further updates)
416+ * @param isFinal ignored — interrupted states are not final per the A2A specification.
417+ * Use {@link #requiresAuth()} instead.
418+ * @deprecated The {@code isFinal} parameter has no effect. Use {@link #requiresAuth()} instead.
425419 */
420+ @ Deprecated (forRemoval = true )
426421 public void requiresAuth (boolean isFinal ) {
427- requiresAuth (null , isFinal );
422+ requiresAuth ();
428423 }
429424
430425 /**
431- * Marks the task as AUTH_REQUIRED with an optional message and finality flag .
426+ * Marks the task as AUTH_REQUIRED with an optional message.
432427 *
433428 * @param message optional message to include
434- * @param isFinal whether this is a final status (prevents further updates)
429+ * @param isFinal ignored — interrupted states are not final per the A2A specification.
430+ * Use {@link #requiresAuth(Message)} instead.
431+ * @deprecated The {@code isFinal} parameter has no effect. Use {@link #requiresAuth(Message)} instead.
435432 */
433+ @ Deprecated (forRemoval = true )
436434 public void requiresAuth (@ Nullable Message message , boolean isFinal ) {
437- updateStatus ( TaskState . TASK_STATE_AUTH_REQUIRED , message , isFinal );
435+ requiresAuth ( message );
438436 }
439437
440438 /**
@@ -569,7 +567,6 @@ public void addTask(Task task) {
569567 * .taskId(context.getTaskId())
570568 * .contextId(context.getContextId())
571569 * .status(new TaskStatus(TaskState.WORKING))
572- * .isFinal(false)
573570 * .build();
574571 * emitter.emitEvent(event);
575572 * }
0 commit comments