Skip to content

fix: graceful ImportError handling in orchestrator_v10_final.py + CI test failures#323

Draft
Copilot wants to merge 4 commits intomainfrom
copilot/fix-import-error-handling
Draft

fix: graceful ImportError handling in orchestrator_v10_final.py + CI test failures#323
Copilot wants to merge 4 commits intomainfrom
copilot/fix-import-error-handling

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 4, 2026

orchestrator_v10_final.py crashed with an unhandled ImportError when any optional subcommand module was missing. Five additional CI tests were failing due to mismatched version strings, missing compliance metadata injection, absent caching, and a wrong HTTP status code on the root route.

Changes

orchestrator_v10_final.py — ImportError handling

Added _missing_module() helper; all 22 subcommand from X import Y imports are now wrapped in try/except ImportError:

if args.cmd == "sacmuseum":
    try:
        from sacmuseum_empire import run_sacmuseum_sovereignty
    except ImportError:
        return _missing_module("sacmuseum_empire")
    run_sacmuseum_sovereignty()
    return 0

stripe_agent.py — Compliance metadata + caching

  • create_product / create_price now always inject siren and patent into metadata, overriding any caller-supplied values for those keys:
    merged_meta = dict(metadata) if metadata else {}
    merged_meta["siren"] = _SIREN
    merged_meta["patent"] = _PATENT
  • list_products now uses the existing _cache_get / _cache_set infrastructure so repeated calls within the TTL window skip the Stripe API.

api/index.py — Root route 404 + sovereignty enrichment

  • Added a POST/PUT/PATCH/DELETE/OPTIONS handler on / that returns {"status": "error", "message": "Not Found"} with status 404 (previously Flask returned 405).
  • Sovereignty payload enrichment (_apply_global_sovereignty_headers) now skips 4xx/5xx responses to avoid polluting error JSON.

api/balance_soberana.py

Reverted version banner from TRYONYOU V12TRYONYOU V10 to match the test assertion.

.gitignore

Added runtime log files (sovereignty_access_audit.jsonl, core_engine_*.jsonl) to the exclude list; removed accidentally-committed entries.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 4, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
tryonyou-app Ready Ready Preview, Comment May 4, 2026 8:51am
tryonyou-app-1776375445 Ready Ready Preview, Comment May 4, 2026 8:51am
tryonyou-app-work Ready Ready Preview, Comment May 4, 2026 8:51am
tryonyou-pilot Ready Ready Preview, Comment May 4, 2026 8:51am
workspace Ready Ready Preview, Comment May 4, 2026 8:51am

Request Review

Copilot AI and others added 2 commits May 4, 2026 08:53
…der, list_products cache

Agent-Logs-Url: https://github.com/Tryonme-com/tryonyou-app/sessions/c1574fb6-daca-4b5b-bedf-e62b669cfd07

Co-authored-by: LVT-ENG <214667862+LVT-ENG@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix import error handling in OrchestratorV10 fix: graceful ImportError handling in orchestrator_v10_final.py + CI test failures May 4, 2026
Copilot finished work on behalf of LVT-ENG May 4, 2026 08:56
Copilot AI requested a review from LVT-ENG May 4, 2026 08:56
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.

orchestrator_v10_final.py

2 participants