Skip to content

Commit 03d17fc

Browse files
committed
ReviewResult state for generated diffs
1 parent b84a25d commit 03d17fc

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

agent/api/agent_server/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class MessageKind(str, Enum):
2727
STAGE_RESULT = "StageResult" # tool was used, and FSM state is expected to be updated
2828
RUNTIME_ERROR = "RuntimeError" # things went wrong!
2929
REFINEMENT_REQUEST = "RefinementRequest" # no tool was used, meaning the agent is asking for more information
30-
FINAL_RESULT = "FinalResult" # generation completed successfully
30+
REVIEW_RESULT = "ReviewResult" # generation completed successfully
3131

3232

3333
class UserMessage(BaseModel):

agent/api/agent_server/test_async_agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ async def test_async_agent_message_endpoint(agent_type):
4343
case AgentSseEvent():
4444
assert event.trace_id == request.trace_id, f"Trace IDs do not match in model objects with agent_type={agent_type}"
4545
assert event.status == AgentStatus.IDLE
46-
assert event.message.kind in (MessageKind.STAGE_RESULT, MessageKind.FINAL_RESULT), f"Message kind {event.message.kind} is not one of the expected kinds"
46+
assert event.message.kind in (MessageKind.STAGE_RESULT, MessageKind.REVIEW_RESULT), f"Message kind {event.message.kind} is not one of the expected kinds"
4747

4848

4949
async def test_async_agent_state_continuation(trpc_agent):

agent/trpc_agent/agent_session.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ async def process(self, request: AgentRequest, event_tx: MemoryObjectSendStream[
235235
traceId=self.trace_id,
236236
message=AgentMessage(
237237
role="assistant",
238-
kind=MessageKind.STAGE_RESULT,
238+
kind=MessageKind.REVIEW_RESULT,
239239
content=json.dumps([x.to_dict() for x in messages], sort_keys=True),
240240
agentState={"fsm_state": fsm_state} if fsm_state else None,
241241
unifiedDiff=initial_template_diff,
@@ -294,7 +294,7 @@ async def process(self, request: AgentRequest, event_tx: MemoryObjectSendStream[
294294
traceId=self.trace_id,
295295
message=AgentMessage(
296296
role="assistant",
297-
kind=MessageKind.FINAL_RESULT,
297+
kind=MessageKind.REVIEW_RESULT,
298298
content=json.dumps([x.to_dict() for x in messages], sort_keys=True),
299299
agentState={"fsm_state": fsm_state} if fsm_state else None,
300300
unifiedDiff=final_diff,
@@ -317,7 +317,7 @@ async def process(self, request: AgentRequest, event_tx: MemoryObjectSendStream[
317317
traceId=self.trace_id,
318318
message=AgentMessage(
319319
role="assistant",
320-
kind=MessageKind.FINAL_RESULT,
320+
kind=MessageKind.STAGE_RESULT,
321321
content=json.dumps([x.to_dict() for x in messages], sort_keys=True),
322322
agentState={"fsm_state": fsm_state} if fsm_state else None,
323323
unifiedDiff=None,
@@ -335,7 +335,6 @@ async def process(self, request: AgentRequest, event_tx: MemoryObjectSendStream[
335335
if not self.user_answered(new_messages) or is_completed:
336336
break
337337

338-
339338
except Exception as e:
340339
logger.exception(f"Error in process: {str(e)}")
341340
error_event = AgentSseEvent(

0 commit comments

Comments
 (0)