Skip to content

Log every server-side safety fallback step on OpenCode 1 and 2 - #863

Closed
antauth-alfonso[bot] wants to merge 3 commits into
mainfrom
fix/861-fallback-logging
Closed

antauth-alfonso[bot] wants to merge 3 commits into
mainfrom
fix/861-fallback-logging

Conversation

@antauth-alfonso

@antauth-alfonso antauth-alfonso Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Refs #861 (part A). One INFO line per served fallback step with per-attempt token counts (no content); OpenCode 2 previously logged nothing, OpenCode 1 only the first handoff. Notice text no longer claims follow-ups stay on the fallback model.


Summary by cubic

Logs every Anthropic server-side safety fallback step on OpenCode 1 and 2, with per-attempt token counts and stop reason but no response content. OpenCode 2 previously logged nothing; OpenCode 1 only logged the first handoff.

  • Each served fallback step now emits an INFO record on the server-fallback channel with requested and served model IDs, handoff flag, stop reason, and per-attempt token counts.
  • Logged metadata is validated and bounded so untrusted usage fields can't inflate or poison the log.
  • The fallback notice text now says the next step retries the requested model instead of claiming follow-ups stay on the fallback model.

Written for commit 0d8b5c2. Summary will update on new commits.

View guided diff Turn on auto-fix

Reuse the hidden usage marker's validation for closed per-attempt INFO metadata on both OpenCode generations. Keep notice deduplication and describe the next step as trying the requested model again, rather than staying on fallback.
@antauth-alfonso

Copy link
Copy Markdown
Author

Squash-merged to main as 3b12e2f.

@antauth-alfonso antauth-alfonso Bot closed this Nov 22, 2026
@ualtinok
ualtinok deleted the fix/861-fallback-logging branch November 22, 2026 09:41
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