Skip to content
This repository was archived by the owner on Oct 1, 2026. It is now read-only.

AAPP-1104: Make AgentLoggingConfig fields Optional + CLI null-check - #46

Merged
HemasumanthDO merged 1 commit into
mainfrom
hrasineni/aapp-1104-galileo-tolerance
May 28, 2026
Merged

HemasumanthDO merged 1 commit into
mainfrom
hrasineni/aapp-1104-galileo-tolerance

Conversation

@HemasumanthDO

Copy link
Copy Markdown
Collaborator

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 AgentWorkspaceDeployment whose logging_config is null (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 would AttributeError at runtime as soon as a CLI user ran gradient agent traces against 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_name are now Optional[str] with default None. insights_enabled_at / insights_enabled were already optional. The container AgentWorkspaceDeployment.logging_config was already Optional[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_console now checks logging_config is None, missing galileo_project_id, or missing log_stream_id before dereferencing, and raises a user-friendly ValueError:

    Tracing is not provisioned for agent deployment '…' in workspace '…'. This usually means the deployment was created while the tracing service was unavailable. Retry once Galileo is healthy, or redeploy the agent.

    No silent failure, no Python traceback.

Why

INCI-2891 — on 2026-04-01, Galileo API keys expired and every CreateAgent returned 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 next gradient agent traces invocation after such a create would crash with AttributeError: 'NoneType' object has no attribute 'galileo_project_id'. This PR closes that gap.

Test plan

  • tests/ (excluding pre-broken test_a2a and runtime/test_crewai which need optional deps): green
  • models.py coverage at 100% in unit tests after the change
  • Manual sanity: AgentLoggingConfig() constructs without arguments; AgentLoggingConfig(galileo_project_id='p', log_stream_id='s') constructs with partial fields; both round-trip through model_dump() cleanly
  • Compile-check (python -m compileall) — clean
  • Manual end-to-end with the cthulhu PR deployed to preview (will be done by reviewer / before the cthulhu PR merges to prod)

Out of scope

  • The cthulhu backend changes themselves — see https://github.internal.digitalocean.com/digitalocean/cthulhu/pull/161628.
  • The auto-reconciler that re-attempts Galileo provisioning for agents created during an outage — intentionally not built because Galileo is being sunset in ~1–2 months.
  • UI click-out behavior for missing logging_config — already handled by useGalileoRedirect.tsx silently disabling the button.

Ref: AAPP-1104, INCI-2891

…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.
@HemasumanthDO
HemasumanthDO merged commit 073c2ae into main May 28, 2026
5 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants