Skip to content

SCA-4388: Preserve explicit summary reprocess failures - #26301

Open
Git-on-my-level wants to merge 7 commits into
mainfrom
agent/m1-studio-codex-sol/f3cf3862b07d
Open

Git-on-my-level wants to merge 7 commits into
mainfrom
agent/m1-studio-codex-sol/f3cf3862b07d

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Carry the selected template's execution failure to the shared conversation-processing HTTP mapper. Explicit reprocess returns typed 429 for provider-account state, typed 503 with Retry-After for transient failures, and the existing 500 for internal faults.

  • Return 502 app_result_failed for empty context or model output. Include failure_class in the 502 detail. The warning uses the same class, the route, and the conversation ID for correlation with the request log. Keep the previous template result. Keep provider exception text and account identifiers out of those diagnostics. Apply derived effects only after the selected template succeeds.

  • Show localized guidance for the three known provider-account codes in the summary card and legacy snackbar. Use gateway guidance for a structured 429 with a missing or unknown code, keep the manual 502 retry, and reuse the single delayed retry for an explicit reprocess with a typed 503.

  • Refund the hourly slot for a typed retryable 503 in its original Redis bucket. Empty selected-app results do not write app usage.

Product invariants affected

  • INV-MEM-4
  • INV-TASK-2

Failure-Class: FC-byok-account-state-escapes-as-server-fault

UI-Evidence: none -- The existing failure card layout is reused. Flutter widget tests verify all three provider-account messages in French on both surfaces.

Verification

Rebased head 6b0dfceed33cc1c1835c5316a699b09b5ba440da on main 269ce9504c9768afb6b1e5dcec45160ec6181fee. All seven patches carried forward unchanged. The feature-flag registry check passed, along with 254 file-isolated backend tests (one skipped) and 83 focused Flutter tests on M1.

Rebased head 6af6a1864e3e7cd44f4d269201ed6d69e7de13d2 on aa995f8e2097de99902c93428ea04eca230b9b4c. The rebase preserves #26258's background Flex behavior and refreshes the active notes-11 source test pin without bumping the runtime prompt version. The file-isolated backend run passed 452 tests with one skip, including the typed response contract, empty-result logging, and background Flex regressions. The four focused Flutter suites passed all 87 tests.

Previous rebase head: 2956efe16974776c120ee67e0035d96429821dee on main 860312c73f6a71126a2e7796663e250bb35da07c. Main supplies the Redis test stub line. The source-digest refresh applies to the active notes-10 pin with no runtime version bump. Focused prompt-digest, rate-limit and reprocess suites passed (108 tests, one skip).

Fix head: 8adfebff113ca4d6e28c921eaccea547a2496799.

The merge repair refreshes the notes-9 source digest pin for the reviewed template-result handling. Notes generation is unchanged and stored checkpoints stay reusable. The prompt-version guard, notes dedupe, prompt caching, and reprocess tests passed (103 tests).

  • 87 focused Flutter tests passed on the ruling repair head, covering typed code decoding, the single delayed retry, all three provider-account messages, and the missing/unknown code fallback on both surfaces. The localization check passed.
  • 149 focused backend tests passed on the reviewed head, including both empty reasons and warning correlation. In the previous round, all 62 selected backend test files passed in the repository's file-isolated runner on M1, with the Homebrew Opus library available. Coverage includes the three provider-account codes, timeout, the kill switch, empty context and output, internal errors, and privacy-safe logging. The requested monolithic pytest command failed during collection. A pure-Python protobuf rerun exposed collisions between module-level test stubs, a documented reason for file isolation.
  • The scoped ruling repair passed 214 focused backend tests, 62 selected files with the isolated runner, and a Redis smoke test for reservation, denial, refund, and bucket rollover.
  • Production verification follows serving. Observe an organic request in the read-only request logs and confirm the next routes tick has no 500 from this failure class.

SCA-4388

Line-Count-Exception: app/lib/backend/http/api/conversations.dart | 1808 -> 1829 | Reuse the existing processing retry and decode the reprocess outcomes at the HTTP boundary.
Line-Count-Exception: app/lib/pages/conversation_detail/conversation_detail_provider.dart | 1592 -> 1603 | Carry the typed provider-account code through the existing failure state.
Line-Count-Exception: app/lib/pages/conversation_detail/page.dart | 2161 -> 2166 | Show the account message in the existing legacy feedback surface.
Line-Count-Exception: backend/utils/conversations/process_conversation.py | 3560 -> 3606 | Preserve the app failure through the worker and defer derived effects until the selected template succeeds.
Line-Count-Exception: backend/routers/conversations.py | 3551 -> 3576 | Keep the existing reprocess response and refund only the original reservation on a typed retryable failure.
Line-Count-Exception: backend/database/redis_db.py | 1671 -> 1694 | Reserve and release within the same rate-limit bucket using the existing scripts.

@github-actions

Copy link
Copy Markdown
Contributor

@kodjima33 UI changes involving Git-on-my-level require your approval. Review the current diff, then comment /approve-ui 06b0ff51de413530226cae64b0455aeebd8a61d4. A later head keeps the approval only when it adds commits on top with no UI changes; a UI change, rebase or force-push needs a fresh one. To withdraw it, comment /reject-ui <full head SHA>. Non-UI work and unrelated access are unaffected.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 06b0ff51de

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@mintlify

mintlify Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
omi 🟢 Ready View Preview Nov 30, 2026, 8:44 AM

💡 Tip: Enable Automations to automatically generate PRs for you.

@github-actions

Copy link
Copy Markdown
Contributor

@kodjima33 UI changes involving Git-on-my-level require your approval. Review the current diff, then comment /approve-ui fba54ded89a937729a0e86394288ebf9be98150c. A later head keeps the approval only when it adds commits on top with no UI changes; a UI change, rebase or force-push needs a fresh one. To withdraw it, comment /reject-ui <full head SHA>. Non-UI work and unrelated access are unaffected.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-29T11:43:44.090160Z 9f9a18a New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

Copy link
Copy Markdown
Contributor

@kodjima33 UI changes involving Git-on-my-level require your approval. Review the current diff, then comment /approve-ui cd0f63bdc43763c9ce74192235d5543c90c15a50. A later head keeps the approval only when it adds commits on top with no UI changes; a UI change, rebase or force-push needs a fresh one. To withdraw it, comment /reject-ui <full head SHA>. Non-UI work and unrelated access are unaffected.

@github-actions

Copy link
Copy Markdown
Contributor

@kodjima33 UI changes involving Git-on-my-level require your approval. Review the current diff, then comment /approve-ui b11fb0fba3c9a827676f84067300815d992f5ae4. A later head keeps the approval only when it adds commits on top with no UI changes; a UI change, rebase or force-push needs a fresh one. To withdraw it, comment /reject-ui <full head SHA>. Non-UI work and unrelated access are unaffected.

@github-actions

Copy link
Copy Markdown
Contributor

@kodjima33 UI changes involving Git-on-my-level require your approval. Review the current diff, then comment /approve-ui 8adfebff113ca4d6e28c921eaccea547a2496799. A later head keeps the approval only when it adds commits on top with no UI changes; a UI change, rebase or force-push needs a fresh one. To withdraw it, comment /reject-ui <full head SHA>. Non-UI work and unrelated access are unaffected.

@github-actions

Copy link
Copy Markdown
Contributor

@kodjima33 UI changes involving Git-on-my-level require your approval. Review the current diff, then comment /approve-ui 57d398ed8612f76f03602a40a42f48ce4d64f130. A later head keeps the approval only when it adds commits on top with no UI changes; a UI change, rebase or force-push needs a fresh one. To withdraw it, comment /reject-ui <full head SHA>. Non-UI work and unrelated access are unaffected.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 57d398ed86

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +944 to +945
from redis.exceptions import RedisError
from utils.llm.gateway_error_contract import is_retryable_processing_http_exception

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Move the new helper imports to module scope

The new refund helper imports Redis and gateway-contract dependencies inside the function, contrary to backend/AGENTS.md: “All imports at module top level — never inside functions.” Move these imports, along with the new function-local reserve_rate_limit_slot import in utils/other/endpoints.py, to their respective module import sections so dependency tracing across the shared backend services remains complete.

AGENTS.md reference: backend/AGENTS.md:L166-L174

Useful? React with 👍 / 👎.

Git-on-my-level commented Nov 26, 2026 •

Copy link
Copy Markdown
Member Author

I extracted the single redis_pkg.RedisError = _RedisError line into #26350 for SCA-4235’s shard 6 carrier failure. The reprocess assertions stay with #26301. If #26301 lands first, Release can drop the standalone repair.

Git-on-my-level added a commit that referenced this pull request Nov 26, 2026
Extracts the single Redis fixture alias from #26301 so the shard 6
repair can move independently. The stub now exports `RedisError` at the
package root, as redis-py does. This resolves the setup import error
from `database.batch_privacy_owner_cache` on main carrier
`751100e704f77c53c45b17e1eb4ac90098f51053`.

`backend/test.sh test_rate_limiting.py` on `multica-worker-1` passed 92
tests with one guarded fakeredis Lua skip. The carrier’s full shard 6
selection passed on `multica-worker-1` (319 files, exit 0) with its
original changed-path list, rotation 4/8, and the CI-style FFmpeg,
FFprobe, and `backend/.venv` setup.

[Failed carrier
shard](https://github.com/BasedHardware/omi/actions/runs/45724903563/job/139598198821)
· [Source PR #26301](#26301)

Product invariants affected: none.
Failure-Class: none
@Git-on-my-level
Git-on-my-level force-pushed the agent/m1-studio-codex-sol/f3cf3862b07d branch from 57d398e to 2956efe Compare November 26, 2026 16:25
@github-actions

Copy link
Copy Markdown
Contributor

@kodjima33 UI changes involving Git-on-my-level require your approval. Review the current diff, then comment /approve-ui 2956efe16974776c120ee67e0035d96429821dee. A later head keeps the approval only when it adds commits on top with no UI changes; a UI change, rebase or force-push needs a fresh one. To withdraw it, comment /reject-ui <full head SHA>. Non-UI work and unrelated access are unaffected.

@github-actions

Copy link
Copy Markdown
Contributor

@kodjima33 UI changes involving Git-on-my-level require your approval. Review the current diff, then comment /approve-ui 6af6a1864e3e7cd44f4d269201ed6d69e7de13d2. A later head keeps the approval only when it adds commits on top with no UI changes; a UI change, rebase or force-push needs a fresh one. To withdraw it, comment /reject-ui <full head SHA>. Non-UI work and unrelated access are unaffected.

@github-actions

Copy link
Copy Markdown
Contributor

@kodjima33 UI changes involving Git-on-my-level require your approval. Review the current diff, then comment /approve-ui 198054f96e649ed9a7e1cdaf328881076de77f49. A later head keeps the approval only when it adds commits on top with no UI changes; a UI change, rebase or force-push needs a fresh one. To withdraw it, comment /reject-ui <full head SHA>. Non-UI work and unrelated access are unaffected.

@github-actions

Copy link
Copy Markdown
Contributor

@kodjima33 UI changes involving Git-on-my-level require your approval. Review the current diff, then comment /approve-ui 5f598a00820b6a61956a45a5bcce9ad5a13e471c. A later head keeps the approval only when it adds commits on top with no UI changes; a UI change, rebase or force-push needs a fresh one. To withdraw it, comment /reject-ui <full head SHA>. Non-UI work and unrelated access are unaffected.

@github-actions

Copy link
Copy Markdown
Contributor

@kodjima33 UI changes involving Git-on-my-level require your approval. Review the current diff, then comment /approve-ui 104384ad5c9b958b1edc0d1d6abaaff1f0569c4d. A later head keeps the approval only when it adds commits on top with no UI changes; a UI change, rebase or force-push needs a fresh one. To withdraw it, comment /reject-ui <full head SHA>. Non-UI work and unrelated access are unaffected.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 104384ad5c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +3388 to +3392
if explicit_reprocess:
if explicit_selection_failures:
# A typed provider failure can replay the request. Leave the
# derived effects for the attempt that actually gets a summary.
return

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Add the required conversation-lifecycle change note

This changes explicit reprocessing so failed app selections skip derived effects and return typed provider failures, but the commit adds no pipeline change note. A search of backend/docs/listen_pusher_pipeline/changes/ also found no note covering these changes. backend/AGENTS.md requires conversation-lifecycle changes to include a note in that directory in the same PR; add one documenting the failure behavior, retry/refund semantics, flag state, and verification evidence.

AGENTS.md reference: backend/AGENTS.md:L164-L164

Useful? React with 👍 / 👎.

@github-actions

Copy link
Copy Markdown
Contributor

@kodjima33 UI changes involving Git-on-my-level require your approval. Review the current diff, then comment /approve-ui 8d51dc89d5564df325e98c934b28e63ab134f865. A later head keeps the approval while the PR's own UI changes stay the same, including after a rebase or a merge from main; a new or edited UI change needs a fresh one. To withdraw it, comment /reject-ui <full head SHA>. Non-UI work and unrelated access are unaffected.

Git-on-my-level added a commit that referenced this pull request Nov 29, 2026
## Summary

Adds the pipeline change note for the explicit-template reprocess
behavior in #26301 (SCA-4388). The note covers typed 429/502/503
responses, both empty-result classes, the Flutter retry, hourly-slot
refund and single usage record, and the existing retryable-provider
switch.

This is the docs-only follow-up for SCA-5595. The live request-log and
tick read remains pending rollout in SCA-4388.

## Verification

- `git diff --check origin/main...HEAD`
- `make preflight`
- `scripts/pr-preflight --pr-body-file ../.sca-5595-pr.md`
- The note links to the passing backend and Flutter checks on #26301 and
to the regression tests.

## Product invariants affected

none


<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/BasedHardware/omi/pull/26673?utm_source=github"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img
alt="View guided diff"
src="https://www.cubic.dev/buttons/review-in-cubic-light.svg"></picture></a>
<a
href="https://www.cubic.dev/action/auto-fix/pr/BasedHardware/omi/26673?returnTo=https%3A%2F%2Fgithub.com%2FBasedHardware%2Fomi%2Fpull%2F26673&source=description"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"><img
alt="Turn on auto-fix"
src="https://www.cubic.dev/buttons/turn-on-auto-fix-light.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->
@Git-on-my-level
Git-on-my-level force-pushed the agent/m1-studio-codex-sol/f3cf3862b07d branch from 8d51dc8 to 9f9a18a Compare November 29, 2026 11:38
@github-actions

Copy link
Copy Markdown
Contributor

@kodjima33 UI changes involving Git-on-my-level require your approval. Review the current diff, then comment /approve-ui 9f9a18a212e7f5e3a4c2aaf6c283f6e5ac21e44d. A later head keeps the approval while the PR's own UI changes stay the same, including after a rebase or a merge from main; a new or edited UI change needs a fresh one. To withdraw it, comment /reject-ui <full head SHA>. Non-UI work and unrelated access are unaffected.

@github-actions

Copy link
Copy Markdown
Contributor

@kodjima33 UI changes involving Git-on-my-level require your approval. Review the current diff, then comment /approve-ui 6b0dfceed33cc1c1835c5316a699b09b5ba440da. A later head keeps the approval while the PR's own UI changes stay the same, including after a rebase or a merge from main; a new or edited UI change needs a fresh one. To withdraw it, comment /reject-ui <full head SHA>. Non-UI work and unrelated access are unaffected.

This branch was successfully deployed

1 active deployment
staging - docs — 6b0dfcee Deployed Nov 30, 2026 by mintlify[bot]
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