Skip to content

fix(agentharness): fall back to status.conditions when phase is UNSPECIFIED#1980

Closed
mesutoezdil wants to merge 1 commit into
kagent-dev:mainfrom
mesutoezdil:fix/agentharness-phase-unspecified-fallback
Closed

fix(agentharness): fall back to status.conditions when phase is UNSPECIFIED#1980
mesutoezdil wants to merge 1 commit into
kagent-dev:mainfrom
mesutoezdil:fix/agentharness-phase-unspecified-fallback

Conversation

@mesutoezdil

@mesutoezdil mesutoezdil commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

When the OpenShell gateway returns phase=UNSPECIFIED (or omits the field), phaseToCondition was setting Ready=Unknown permanently and requeuing every 10s, even when status.conditions[Ready=True] was present in the same response.

Adds a fallback: when phase is UNSPECIFIED or UNKNOWN, check status.conditions for Ready=True before returning unknown.

Fixes #1958

…CIFIED

When the OpenShell gateway omits the phase field (returns UNSPECIFIED),
the controller was setting Ready=Unknown permanently. If status.conditions
contains Ready=True, use that instead.

Fixes kagent-dev#1958
Signed-off-by: mesutoezdil <mesudozdil@gmail.com>
Copilot AI review requested due to automatic review settings June 8, 2026 17:35
@github-actions github-actions Bot added the bug Something isn't working label Jun 8, 2026

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.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds more robust readiness mapping for OpenShell sandboxes by treating UNKNOWN/UNSPECIFIED phases as ready when the sandbox reports a Ready=True condition, and adds unit tests to lock in the behavior.

Changes:

  • Update phaseToCondition to fall back to Ready=True conditions for UNKNOWN/UNSPECIFIED phases
  • Add table-driven tests covering nil, explicit phases, and the new fallback behavior

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
go/core/pkg/sandboxbackend/openshell/translate.go Adds fallback logic that checks Ready=True conditions when phase is unknown/unspecified
go/core/pkg/sandboxbackend/openshell/translate_test.go Introduces unit tests validating phaseToCondition across phases and fallback cases

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

Comment on lines +81 to +85
for _, c := range sb.GetStatus().GetConditions() {
if c.GetType() == "Ready" && c.GetStatus() == "True" {
return metav1.ConditionTrue, "SandboxReady", msg
}
}
@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels Jun 8, 2026
@mesutoezdil

Copy link
Copy Markdown
Contributor Author

Closing as duplicate of #1966.

@mesutoezdil mesutoezdil closed this Jun 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AgentHarness: phaseToCondition should fall back to status.conditions when phase=UNSPECIFIED

2 participants