Skip to content

Commit 600bc84

Browse files
fix(demo-client): reset LAST_EVENT_ID on fresh task start
When reusing a session for a new task, the stale LAST_EVENT_ID from the previous run caused the client to skip the first stage header. Now resets to 0 when POST returns status='started'. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 0175d1e commit 600bc84

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

  • sdk/agentserver/azure-ai-agentserver-invocations/samples/durable-agent-demo

sdk/agentserver/azure-ai-agentserver-invocations/samples/durable-agent-demo/demo-client.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,10 @@ dispatch_task() {
199199
if [[ -n "$sess" ]]; then
200200
SESSION_ID="$sess"
201201
fi
202+
# Reset event tracking when a fresh task starts (not a reconnect)
203+
if [[ "$status" == "started" ]]; then
204+
LAST_EVENT_ID="0"
205+
fi
202206
save_session
203207

204208
echo -e "${DIM}Task ${status}: inv=${INV_ID:0:30}...${RESET}"

0 commit comments

Comments
 (0)