fix(sms-bridge): classify OpenCode error envelopes - #42
Merged
Conversation
Image CI passedPre-commit validation passed. View the workflow run. |
14 tasks
xnoto
added a commit
to makeitworkcloud/kustomize-cluster
that referenced
this pull request
Sep 5, 2026
## Summary Select `ghcr.io/makeitworkcloud/opencode-sms-bridge:e9130e6ac0a4eb4bb7c47bea79807b873ce5a9cc`, the immutable image published after [images PR #42](makeitworkcloud/images#42). It distinguishes a structurally valid OpenCode V1 error envelope from malformed or textless non-error responses with the static PII-safe code `opencode-response-error`. **Verified producer evidence:** [images buildah run 33977700201](https://github.com/makeitworkcloud/images/actions/runs/33977700201) passed checks, detected `opencode-sms-bridge`, built it, and completed registry push for this immutable tag. This PR changes only the bridge image tag. It changes no chart version, route, routing/allowlist, Secret, Service, TunnelBinding, provider/model configuration, or Argo sync policy. Fixes # None — owner-authorized diagnostic rollout; no driving issue supplied. ## Type of change - [x] Bug fix - [ ] Feature / enhancement - [ ] Documentation - [ ] Infrastructure (OpenTofu root or module) - [x] GitOps desired state (manifests, kustomize, charts, SOPS/KSOPS secrets) - [ ] Container image - [ ] CI / reusable workflow - [ ] Refactor /cleanup - [ ] Breaking change ## Validation - [ ] Required pull-request checks pass — pending. Repository PR CI is the validation authority. - [x] Generated or centrally distributed files were regenerated by their owning automation, not hand-edited — none apply; this is a one-line immutable image-pin change. No local OpenTofu, SOPS, container build, cluster, or live-system operation was run or claimed. ## Impact and rollout **Producer:** `images` merged `e9130e6…`; its post-merge build and registry push succeeded. **Consumer:** `workloads/apps/opencode-sms-bridge-app.yaml` is the canonical GitOps image-selection point. This PR proposes selection only. **Delivery stages:** source is merged, published, and producer-validated; GitOps selection is proposed and PR validation is pending. An authorized merge runs `test` on `main`; only a successful test triggers automatic root-sync submission. Root and child reconciliation, resource health, and another approved-source SMS test remain separate verification stages. **Behavior boundary:** this rollout improves safe error classification only. It does not claim to resolve the underlying provider-side failure that produced the prior no-text error turn. **Rollback:** use a reviewed GitOps PR to restore the prior immutable tag `adb1e0e72729a7182b4a4929bd67e0275fba8173`; do not retag images or patch live resources. ## Safety and secrets - [x] Contains no plaintext secrets, decrypted SOPS values, state files, kubeconfigs, tokens, or private endpoints - [x] No local OpenTofu init/plan/apply/destroy/import/state operations were run or claimed — plans come from pull-request checks - [x] Breaking or irreversible effects are described above with rollback notes AI-assisted change: an OpenCode agent materially produced this change; review the producer evidence, one-line diff, and automatic post-merge reconciliation behavior before merge.
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.
Summary
Distinguish a structurally valid OpenCode V1 message envelope that reports
info.errorfrom malformed or textless non-error responses. The bridge now records the new static, PII-safe codeopencode-response-error, rather than collapsing the envelope intoopencode-response-invalid.The latest approved-source SMS test reached bounded ingress and worker stages but stopped at
stage=opencodewith the existing generic invalid-response code. Upstream v1.18.23's processor persists a provider/runtime failure into the assistant message and returns a normal message envelope; this change makes that documented envelope observable without carrying upstream error text, identifiers, or payload data into bridge exceptions, logs, or storage.This is a diagnostic-classification repair only. It does not claim to repair the underlying provider-side failure or to produce an outbound SMS on an error turn.
Fixes #
None — owner-authorized bounded remediation; no driving issue supplied.
Type of change
Validation
imagespull-request workflow is the validation authority.The added unit case pins a valid
{info, parts}envelope containinginfo.error, asserts exactopencode-response-error, and asserts a representative upstream error detail is not exposed. Existing malformed/no-text non-error cases remainopencode-response-invalid.No local tests, container builds, OpenTofu, SOPS, cluster, or live-system operation was run or claimed.
Impact and rollout
Producer:
makeitworkcloud/images/opencode-sms-bridgeis the canonical image source. After an explicitly authorized merge, the normalmainbuild publishes an immutable image tag.Consumer:
kustomize-clusterremains unchanged. A separate reviewed GitOps image-selection PR and explicit merge authorization would be required to select any published image; reconciliation, health, and a new approved-source SMS test remain separate stages.Behavior: no routes, HTTP bodies, agent routing, model/provider selection, Secrets, or Twilio calls change. A valid upstream error envelope is now persisted as a distinct static code. The underlying provider-side cause remains unknown/blocker; do not infer or alter provider configuration from this classification alone.
Rollback: select the previously reviewed immutable bridge tag through the canonical GitOps workflow; do not retag images or patch live resources.
Safety and secrets
AI-assisted change: an OpenCode agent materially produced this change; review the strict structural check, static-code-only branch, and PII-safety test before merge.