fix(agentharness): fall back to status.conditions when phase is UNSPECIFIED#1980
Closed
mesutoezdil wants to merge 1 commit into
Closed
fix(agentharness): fall back to status.conditions when phase is UNSPECIFIED#1980mesutoezdil wants to merge 1 commit into
mesutoezdil wants to merge 1 commit into
Conversation
…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>
Contributor
There was a problem hiding this comment.
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
phaseToConditionto fall back toReady=Trueconditions forUNKNOWN/UNSPECIFIEDphases - 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 | ||
| } | ||
| } |
Contributor
Author
|
Closing as duplicate of #1966. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When the OpenShell gateway returns
phase=UNSPECIFIED(or omits the field),phaseToConditionwas settingReady=Unknownpermanently and requeuing every 10s, even whenstatus.conditions[Ready=True]was present in the same response.Adds a fallback: when phase is
UNSPECIFIEDorUNKNOWN, checkstatus.conditionsforReady=Truebefore returning unknown.Fixes #1958