This repository was archived by the owner on Oct 1, 2026. It is now read-only.
Repository navigation
AAPP-1104: Make AgentLoggingConfig fields Optional + CLI null-check - #46
Merged
Merged
Conversation
…104) The cthulhu API can now return an AgentLoggingConfig with empty Galileo fields when an agent or deployment was created during a Galileo outage and provisioning was deferred. Two follow-ups here so the SDK and the gradient agent traces CLI do not crash on the nullable state: - models.AgentLoggingConfig: galileo_project_id, galileo_project_name, log_stream_id, log_stream_name are now Optional[str] (default None). Existing populated payloads continue to deserialize unchanged. - cli/agent/traces_service.GalileoTracesService.open_traces_console: raise a user-friendly ValueError when logging_config or the Galileo identifiers are missing, instead of throwing AttributeError on direct field access.
ypeng1
approved these changes
May 28, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Summary
Companion to the cthulhu AAPP-1104 PR (https://github.internal.digitalocean.com/digitalocean/cthulhu/pull/161628). After that change, the GenAI API can return an
AgentWorkspaceDeploymentwhoselogging_configisnull(or whose individual Galileo identifier fields are unset) when the deployment was created during a Galileo outage and provisioning was deferred. The proto field was already optional, but the gradient-adk SDK marked the inner fields as required (Field(...)), which wouldAttributeErrorat runtime as soon as a CLI user rangradient agent tracesagainst such a deployment.This change makes the SDK and the CLI safe under the new nullable state.
What's in the box
gradient_adk/digital_ocean_api/models.py—AgentLoggingConfig.galileo_project_id,galileo_project_name,log_stream_id,log_stream_nameare nowOptional[str]with defaultNone.insights_enabled_at/insights_enabledwere already optional. The containerAgentWorkspaceDeployment.logging_configwas alreadyOptional[AgentLoggingConfig], so this lines up with the parent's existing nullability. Existing populated payloads continue to deserialize unchanged.gradient_adk/cli/agent/traces_service.py—GalileoTracesService.open_traces_consolenow checkslogging_config is None, missinggalileo_project_id, or missinglog_stream_idbefore dereferencing, and raises a user-friendlyValueError:No silent failure, no Python traceback.
Why
INCI-2891 — on 2026-04-01, Galileo API keys expired and every
CreateAgentreturned 500 for ~6.5 h. The cthulhu PR makes Galileo provisioning best-effort so creates succeed during such outages. That's a backend-only fix; the SDK still asserts the fields are populated, so the nextgradient agent tracesinvocation after such a create would crash withAttributeError: 'NoneType' object has no attribute 'galileo_project_id'. This PR closes that gap.Test plan
tests/(excluding pre-brokentest_a2aandruntime/test_crewaiwhich need optional deps): greenmodels.pycoverage at 100% in unit tests after the changeAgentLoggingConfig()constructs without arguments;AgentLoggingConfig(galileo_project_id='p', log_stream_id='s')constructs with partial fields; both round-trip throughmodel_dump()cleanlypython -m compileall) — cleanOut of scope
useGalileoRedirect.tsxsilently disabling the button.Ref: AAPP-1104, INCI-2891