Skip to content

test(desktop): add agent stress diagnostics and resilience gauntlet - #9248

Merged
Git-on-my-level merged 6 commits into
mainfrom
codex/desktop-agent-stress-resilience-harness
Jul 8, 2026
Merged

Git-on-my-level merged 6 commits into
mainfrom
codex/desktop-agent-stress-resilience-harness

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Jul 8, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Add stress_ptt_chat.py plus Swift-side diagnostic models/tests for PTT, realtime, chat bridge, and subagent stress JSONL release gates.
  • Add the agent-continuity gauntlet resilience suite with JSONL diagnostics, manifest counts, self-check wiring, and release-candidate docs.
  • Add a desktop changelog fragment for the new diagnostic/resilience coverage.

Review findings and fixes

  • Reviewer A found live stress probes could classify failed bridge actions as success. Fixed by adding scenario-specific success reasons, treating ok:false / action errors / unknown explicit reasons as forbidden failures, and covering the contract in tests.
  • Reviewer A found offline stress validation could pass without required stress coverage. Fixed by adding repeatable --require-scenario gates and documenting the release-candidate command requiring all four scenarios.
  • Reviewer A found automation tokens could be sent to arbitrary URLs. Fixed by defaulting token use to loopback bridge URLs unless --allow-remote-token is explicitly passed.
  • Reviewer B found R3 already-running/race coverage could be skipped while resilience passed. Fixed by making skipped R3 terminal reasons forbidden diagnostics so --suite resilience cannot go green while that bad-state path is uncovered.
  • Reviewer B found resilience classification could scan stale chat history. Fixed by classifying current-turn snapshot/assistant text only and including current snapshot error fields.

Verification

  • python3 -m py_compile desktop/macos/scripts/stress_ptt_chat.py - passed
  • python3 -m py_compile desktop/macos/scripts/agent-continuity-gauntlet-lib.py - passed
  • python3 desktop/macos/scripts/stress_ptt_chat.py --input-jsonl /tmp/omi-stress-pass.jsonl --require-scenario ptt_voiced --require-scenario ptt_silent --require-scenario chat_bridge --require-scenario subagent_launch - passed with passed_release_gate: true
  • python3 desktop/macos/scripts/stress_ptt_chat.py --input-jsonl /tmp/omi-stress-fail.jsonl - failed as expected with exit 2 and audio_frames_missing
  • cd desktop/macos && ./scripts/agent-continuity-gauntlet.sh --self-check - passed
  • cd desktop/macos && xcrun swift test --package-path Desktop --filter DesktopStressHarnessTests - passed, 7 tests
  • cd desktop/macos && xcrun swift test --package-path Desktop --filter AgentContinuityGauntletTests - passed, 5 tests
  • python3 .github/scripts/desktop-changelog.py validate - passed
  • python3 .github/scripts/check-desktop-changelog.py --base origin/main --head HEAD - passed
  • git diff --check HEAD~1 HEAD - passed
  • git push -u origin codex/desktop-agent-stress-resilience-harness - pre-push hooks passed, including desktop Swift build; emitted existing/advisory warnings for the large gauntlet script/function and existing Swift warnings

Manual QA notes

  • Did not launch or restart any production Omi app or production bundle.
  • Did not run a live named-bundle gauntlet against real LLM/realtime credentials in this review pass; this PR adds/validates the harnesses and offline/self-check gates.

Review in cubic

@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: 7747c9009d

ℹ️ 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".

@cubic-dev-ai cubic-dev-ai 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.

7 issues found across 9 files

Confidence score: 2/5

  • In desktop/macos/scripts/stress_ptt_chat.py, the loopback check accepts hostname.startswith("127."), so values like 127.evil.com can route the automation bearer token to a non-local host; merging as-is risks credential exfiltration from the local trust boundary — tighten host validation to true loopback/IP parsing before merge.
  • In desktop/macos/scripts/stress_ptt_chat.py, the early-return path trusts terminal_reason even when the bridge payload reports failure (ok: false/error), which can misclassify failed runs as success and mask real regressions — gate success classification on explicit success fields and only accept terminal reasons from successful responses.
  • In desktop/macos/scripts/stress_ptt_chat.py, type handling around JSONL fields and bridge result: null is brittle, so malformed inputs can throw TypeError or incorrectly pass validation, causing harness crashes or noisy/incorrect outcomes — add defensive type checks and null-safe parsing with explicit failure diagnostics before merging.
  • In desktop/macos/scripts/agent-continuity-gauntlet-lib.py, resilience evidence/scoring is currently unreliable because forbidden-pattern reporting uses global trace data and the token self-check is tautological, which can produce misleading pass/fail signals — scope evidence to matched traces and replace the substring self-check with a non-tautological verification step.

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

@Git-on-my-level Git-on-my-level added the no-changelog-needed Skip desktop changelog enforcement for internal-only changes label Jul 8, 2026
@Git-on-my-level
Git-on-my-level force-pushed the codex/desktop-agent-stress-resilience-harness branch from 7747c90 to e0bbe16 Compare July 8, 2026 02:55

@cubic-dev-ai cubic-dev-ai 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.

1 issue found across 10 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

@Git-on-my-level
Git-on-my-level force-pushed the codex/desktop-agent-stress-resilience-harness branch from d3f2a6d to 34ac803 Compare July 8, 2026 03:13
@Git-on-my-level
Git-on-my-level force-pushed the codex/desktop-agent-stress-resilience-harness branch from 34ac803 to 33f0cec Compare July 8, 2026 03:34
@Git-on-my-level

Copy link
Copy Markdown
Member Author

Monitor follow-up complete.

Changed:

  • Added exhaustive Swift assertions for the remaining stress terminal failure reasons (bargeInReplacementTimeout and staleProviderAudioAfterInterrupt).
  • Resolved the previously addressed loopback-hostname and failed-terminal-reason review threads after confirming the fixes are in the current head.

Verification passed:

  • xcrun swiftc -parse desktop/macos/Desktop/Tests/DesktopStressHarnessTests.swift
  • git diff --check
  • GitHub checks are green/pass or skipped for this PR, including Desktop Swift Build & Tests, Hygiene, contracts, and desktop-core-e2e-t0.
  • Final review-thread re-scan found no unresolved review threads.

Tighten realtime hub admission for very short PTT turns without rejecting clear short replies, and reject unexpected-language Gemini ask_higher_model tool calls before they hit the higher-model endpoint.

Verification:

- xcrun swift test --package-path Desktop --filter PushToTalkSpeechGateTests --jobs 1

- xcrun swift test --package-path Desktop --filter HubEscalationTests --jobs 1

- xcrun swift test --package-path Desktop --filter HubSystemInstructionTests --jobs 1

- TMPDIR=/tmp/omi-pr-9248-ptt-lang OMI_APP_NAME=omi-pr-9248-ptt-lang OMI_AUTOMATION_PORT=47949 ./run.sh --yolo
Add RealtimeHubTools.swift to the floating bar functional e2e coverage map so Desktop Swift CI recognizes the PTT realtime hub tool changes as covered.

Verification:

- python3 desktop/macos/scripts/check-e2e-flow-coverage.py --strict --base origin/main
@Git-on-my-level
Git-on-my-level merged commit 9d08859 into main Jul 8, 2026
19 checks passed
@Git-on-my-level
Git-on-my-level deleted the codex/desktop-agent-stress-resilience-harness branch July 8, 2026 06:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog-needed Skip desktop changelog enforcement for internal-only changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant