Skip to content

🔧 fix: conditionally display duration and CS based on bot environment#1985

Merged
mkmccarty merged 1 commit intomainfrom
mm-branch-1
Dec 25, 2025
Merged

🔧 fix: conditionally display duration and CS based on bot environment#1985
mkmccarty merged 1 commit intomainfrom
mm-branch-1

Conversation

@mkmccarty
Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings December 25, 2025 16:46
@mkmccarty mkmccarty merged commit fac0c77 into main Dec 25, 2025
14 checks passed
@mkmccarty mkmccarty deleted the mm-branch-1 branch December 25, 2025 16:46
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds conditional logic to display different estimated duration and CS (Contract Score) values based on whether the bot is running in development mode. The changes ensure that the dev bot shows maximum estimates (EstimatedDurationMax, CxpMax) while the production bot shows standard estimates (EstimatedDuration, Cxp).

Key Changes

  • Added config.IsDevBot() conditional check to differentiate between dev and production environments
  • Dev bot now displays EstimatedDurationMax and CxpMax values for debugging/testing purposes
  • Production bot continues to display standard EstimatedDuration and Cxp values

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/boost/replay.go
Comment on lines +439 to +445
if config.IsDevBot() {
fmt.Fprintf(&builder, "**Duration:** %s **Est. Duration:** %s\n", bottools.FmtDuration(time.Duration(evaluation.GetCompletionTime()*float64(time.Second))), bottools.FmtDuration(c.EstimatedDurationMax))
fmt.Fprintf(&builder, "**CS:** %d **Est CS:** %.0f (SR estimation)\n", uint32(evaluationCxp), c.CxpMax)
} else {
fmt.Fprintf(&builder, "**Duration:** %s **Est. Duration:** %s\n", bottools.FmtDuration(time.Duration(evaluation.GetCompletionTime()*float64(time.Second))), bottools.FmtDuration(c.EstimatedDuration))
fmt.Fprintf(&builder, "**CS:** %d **Est CS:** %.0f (SR estimation)\n", uint32(evaluationCxp), c.Cxp)
}
Copy link

Copilot AI Dec 25, 2025

Choose a reason for hiding this comment

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

These two branches duplicate the formatting logic and only differ in the variable used for estimated values. Consider extracting the condition to select the appropriate variables first, then use a single fmt.Fprintf call. This would improve maintainability by eliminating the duplication.

For example:

estimatedDuration := c.EstimatedDuration
estimatedCxp := c.Cxp
if config.IsDevBot() {
    estimatedDuration = c.EstimatedDurationMax
    estimatedCxp = c.CxpMax
}
fmt.Fprintf(&builder, "**Duration:** %s  **Est. Duration:** %s\n", bottools.FmtDuration(time.Duration(evaluation.GetCompletionTime()*float64(time.Second))), bottools.FmtDuration(estimatedDuration))
fmt.Fprintf(&builder, "**CS:** %d  **Est CS:** %.0f (SR estimation)\n", uint32(evaluationCxp), estimatedCxp)
Suggested change
if config.IsDevBot() {
fmt.Fprintf(&builder, "**Duration:** %s **Est. Duration:** %s\n", bottools.FmtDuration(time.Duration(evaluation.GetCompletionTime()*float64(time.Second))), bottools.FmtDuration(c.EstimatedDurationMax))
fmt.Fprintf(&builder, "**CS:** %d **Est CS:** %.0f (SR estimation)\n", uint32(evaluationCxp), c.CxpMax)
} else {
fmt.Fprintf(&builder, "**Duration:** %s **Est. Duration:** %s\n", bottools.FmtDuration(time.Duration(evaluation.GetCompletionTime()*float64(time.Second))), bottools.FmtDuration(c.EstimatedDuration))
fmt.Fprintf(&builder, "**CS:** %d **Est CS:** %.0f (SR estimation)\n", uint32(evaluationCxp), c.Cxp)
}
estimatedDuration := c.EstimatedDuration
estimatedCxp := c.Cxp
if config.IsDevBot() {
estimatedDuration = c.EstimatedDurationMax
estimatedCxp = c.CxpMax
}
fmt.Fprintf(&builder, "**Duration:** %s **Est. Duration:** %s\n", bottools.FmtDuration(time.Duration(evaluation.GetCompletionTime()*float64(time.Second))), bottools.FmtDuration(estimatedDuration))
fmt.Fprintf(&builder, "**CS:** %d **Est CS:** %.0f (SR estimation)\n", uint32(evaluationCxp), estimatedCxp)

Copilot uses AI. Check for mistakes.
@mkmccarty
Copy link
Copy Markdown
Owner Author

@copilot open a new pull request to apply changes based on the comments in this thread

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.

2 participants