Skip to content

[codex] handle gc v1 readiness items shape#189

Merged
boshu2 merged 1 commit intomainfrom
codex/gascity-readiness-v1-compat
Apr 30, 2026
Merged

[codex] handle gc v1 readiness items shape#189
boshu2 merged 1 commit intomainfrom
codex/gascity-readiness-v1-compat

Conversation

@boshu2
Copy link
Copy Markdown
Owner

@boshu2 boshu2 commented Apr 30, 2026

Summary

  • Add items support to gascity.ReadinessResponse while keeping the legacy top-level readiness fields.
  • Add IsReady() and EffectiveStatus() helpers so the worker no longer treats gc v1 readiness responses as false zero-values.
  • Cover legacy, gc v1, partial, empty, and degraded-blocking readiness cases.

Why

When agentopsd is configured with --executor-policy=gascity, gc v1.0.0 returns /v0/city/<name>/readiness as an items map instead of the older top-level {ready,status,...} shape. The worker decoded that into Ready=false and refused every job before creating a GasCity session.

Scope

This is intentionally limited to Drift 1 from the 2026-04-29 handoff. It does not change session-create options handling; the gc v1 unknown-options contract drift is tracked separately in soc-6hgw.

Validation

  • git diff --check main...HEAD
  • go test ./internal/gascity ./internal/agentworker from cli/
  • go vet ./internal/gascity ./internal/agentworker from cli/
  • make -C cli build
  • git push pre-push fast gate passed

Adds Items map + IsReady()/EffectiveStatus() helpers to gascity.ReadinessResponse
so the agentopsd worker accepts both the legacy {ready,status,...} shape and the
gc v1.0.0+ {items:{...}} shape served by the public Gas City supervisor.

Discovered while wiring agentopsd to a brew-installed gc 1.0.0 supervisor
(bushido WSL, 2026-04-29): the worker rejected every job with 'gascity city
"bushido" not ready' because the supervisor returns providers.items, not a
top-level ready bool. With this change readiness passes for any city that has
at least one provider in 'configured' or 'ready' status and no item in
'degraded'/'error'/'unavailable'.

Tests: TestReadinessResponseIsReadyBothShapes covers legacy + v1 + partial +
empty + degraded-blocking cases.

Follow-up (NOT in this commit): gc v1.0.0 also rejects unknown session-create
options keys, blocking the next step in the agentopsd→gascity flow. Either
agentops should namespace its metadata keys, or gc should accept them; needs
upstream coordination. Tracked in bd issue (filed sibling).
@github-actions github-actions Bot added the cli label Apr 30, 2026
@boshu2 boshu2 marked this pull request as ready for review April 30, 2026 12:06
@boshu2 boshu2 merged commit 64d28f0 into main Apr 30, 2026
33 of 34 checks passed
@boshu2 boshu2 deleted the codex/gascity-readiness-v1-compat branch April 30, 2026 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants