Skip to content

fix(sms-bridge): classify OpenCode error categories - #43

Merged
xnoto merged 4 commits into
mainfrom
fix/sms-bridge-error-category
Sep 5, 2026
Merged

fix(sms-bridge): classify OpenCode error categories#43
xnoto merged 4 commits into
mainfrom
fix/sms-bridge-error-category

Conversation

@xnoto

@xnoto xnoto commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Classify a structurally valid OpenCode V1 info.error envelope into a closed, PII-safe bridge error-code taxonomy. The bridge retains only the OpenCode named-error category and, for APIError, a numeric HTTP status in the finite 100–599 range plus retryability. It never carries error messages, response bodies, headers, metadata, IDs, or credentials into logs, persisted job detail, or exceptions.

This follows the approved-sender test that reached the healthy bridge and returned the bounded opencode-response-error result. It is a diagnostic repair, not a provider/configuration change and does not claim to resolve the underlying OpenCode execution failure.

Fixes #

None — owner-authorized diagnostic remediation; no driving issue supplied.

Type of change

  • Bug fix
  • Feature / enhancement
  • Documentation
  • Infrastructure (OpenTofu root or module)
  • 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; the images pull-request workflow is the validation authority.
  • Generated or centrally distributed files were regenerated by their owning automation, not hand-edited — none apply.

Added regression coverage for malformed JSON error names, named OpenCode error categories, API status/retryability bounds, and static-code-only behavior. The repository PR workflow runs pre-commit, Gitleaks, hadolint, and actionlint; it does not run the Python unit tests, so no local test execution is claimed. GitHub Advanced Security targeted scanning is unavailable for this repository; CI Gitleaks remains pending.

Impact and rollout

Producer: makeitworkcloud/images/opencode-sms-bridge is the canonical source. After an explicitly approved merge, the main build automatically publishes a new immutable image tag.

Consumer: kustomize-cluster is unchanged. Selecting any published tag requires a separate reviewed GitOps PR and explicit merge authorization. Argo reconciliation, workload health, and a new approved-sender SMS test are separate downstream gates.

Behavior: V1 routes, request bodies, agent routing, model/provider selection, Secrets, and Twilio outbound behavior are unchanged. A valid OpenCode error turn becomes a bounded category such as provider-auth, context-overflow, or a finite API status/retryability code. The exact provider/runtime cause remains unknown until a post-rollout test yields that category.

Rollback: select the previously reviewed immutable bridge tag through canonical GitOps; do not retag an image or patch the live Deployment.

Safety and secrets

  • Contains no plaintext secrets, decrypted SOPS values, state files, kubeconfigs, tokens, or private endpoints
  • No local OpenTofu init/plan/apply/destroy/import/state operations were run or claimed — plans come from pull-request checks
  • Breaking or irreversible effects are described above with rollback notes

AI-assisted change: an OpenCode agent materially produced this change. Independent review identified and verified the malformed-error-name regression guard before PR creation.

@xnoto
xnoto requested a review from a team as a code owner September 5, 2026 17:02
@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown

Image CI passed

Pre-commit validation passed. View the workflow run.

@xnoto
xnoto merged commit 3557299 into main Sep 5, 2026
4 checks passed
@xnoto
xnoto deleted the fix/sms-bridge-error-category branch September 5, 2026 17:05
xnoto added a commit to makeitworkcloud/kustomize-cluster that referenced this pull request Sep 5, 2026
## Summary

Select the published `opencode-sms-bridge` image tag
`35572992f220a0b378bb76283befd1000a0751d6`, produced by [images PR
#43](makeitworkcloud/images#43). The image
classifies valid OpenCode V1 error turns using a closed PII-safe
category, retaining only named-error category and, for API errors,
finite HTTP status/retryability.

Fixes #

None — owner-authorized image-selection follow-up; 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; `kustomize-cluster`
PR CI is the validation authority.
- [x] Generated or centrally distributed files were regenerated by their
owning automation, not hand-edited — none apply; the canonical child
Application pin is changed directly.

Producer evidence: [images `main` build/push run
`33979838233`](https://github.com/makeitworkcloud/images/actions/runs/33979838233)
succeeded, including the registry push step for the immutable source
commit tag. No local Kubernetes, SOPS, OpenTofu, or live-system
operation was run or claimed.

## Impact and rollout

**Producer:** `makeitworkcloud/images/opencode-sms-bridge` published the
selected immutable tag after PR #43 merged.

**Consumer:** this PR changes only
`workloads/apps/opencode-sms-bridge-app.yaml`; chart version `0.1.2`,
Secrets, routing, Service, PVC, TunnelBinding, and OpenCode/provider
configuration remain unchanged.

**Delivery stages:** this PR authors GitOps desired state only. After an
explicitly approved merge and successful `main` test, the automatic
`sync` workflow submits root reconciliation. Then verify root revision,
child source revisions and health, Pod image/digest/readiness, and one
approved-sender text-only SMS separately.

**Rollback:** select the prior reviewed immutable bridge tag through a
focused GitOps PR; do not retag images or patch the live Deployment.

## 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.
Reviewers should verify the one-line immutable image selection, producer
build/push evidence, and post-merge rollout gates.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant