Skip to content

Commit c3b8a7e

Browse files
committed
Updated the agent API and models to include the FinalResult enumeration.
1 parent edfc454 commit c3b8a7e

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

agent/api/agent_server/agent_api.tsp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ enum MessageKind {
3838

3939
@doc("The agent encountered an error it couldn't recover from. Retrying likely requires user intervention or infrastructure changes.")
4040
RuntimeError,
41+
42+
@doc("The final successful result indicating the application generation is complete and ready for deployment.")
43+
FinalResult,
4144
}
4245

4346
// --- Models ---

agent/api/agent_server/models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +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
3031

3132

3233
class UserMessage(BaseModel):

agent/trpc_agent/agent_session.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ async def process(self, request: AgentRequest, event_tx: MemoryObjectSendStream[
256256
traceId=self.trace_id,
257257
message=AgentMessage(
258258
role="assistant",
259-
kind=MessageKind.STAGE_RESULT,
259+
kind=MessageKind.FINAL_RESULT,
260260
content=json.dumps([x.to_dict() for x in messages], sort_keys=True),
261261
agentState={"fsm_state": fsm_state} if fsm_state else None,
262262
unifiedDiff=final_diff,

0 commit comments

Comments
 (0)