Skip to content

Fix duration calculation for agent stop command - #338278

Merged
Connor Peet (connor4312) merged 3 commits into
microsoft:mainfrom
denizguney:patch-43
Oct 5, 2026
Merged

Connor Peet (connor4312) merged 3 commits into
microsoft:mainfrom
denizguney:patch-43

Conversation

@denizguney

Copy link
Copy Markdown
Contributor

Closes #338277

Implement negative duration protection against clock skew to prevent invalid timestamp subtraction.
Copilot AI balanced review requested due to automatic review settings September 27, 2026 23:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The logic correctly addresses the reported issue; only a minor comment-language cleanup remains.

Review effort: Balanced
Findings: 1 Low severity

Open (1)
What changed in this PR

Prevents negative agent-turn durations caused by clock skew.

Changes:

  • Captures current and start timestamps.
  • Clamps negative durations to zero.
File Description
cli/​src/​commands/​agent_stop.rs Adds defensive duration calculation.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread cli/src/commands/agent_stop.rs Resolved
roblourens
roblourens previously approved these changes Sep 29, 2026
@roblourens

Copy link
Copy Markdown
Member

cc Connor Peet (@connor4312)

Comment thread cli/src/commands/agent_stop.rs Resolved
@connor4312
Connor Peet (connor4312) merged commit 1a94482 into microsoft:main Oct 5, 2026
39 of 66 checks passed
@vs-code-engineering vs-code-engineering Bot added this to the 1.142.0 milestone Oct 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[agent_stop] Prevent potential negative duration calculation due to clock skew

6 participants