# shadowysphinx/opencode-unlimited-limit-bypass- architecture

> Architecture diagram of the GitHub repository shadowysphinx/opencode-unlimited-limit-bypass-, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shadowysphinx/opencode-unlimited-limit-bypass-
- Repository: https://github.com/shadowysphinx/opencode-unlimited-limit-bypass-

## Overview

Opencode Unlimited monitors OpenCode for rate-limit walls, routes traffic through a selectable egress, rotates that egress, then clears client-side lockout state and resumes affected sessions. The dashboard and diagnostics expose configuration and health; keeper and watchdog workers maintain network services. The README documents prefix, WarpGate, and hybrid relay lanes. Some subsystems are represented from documented capabilities and the source index; dashed edges mark relationships not established by the excerpts.

Main entry points: [`src/proxy_chain.py`](https://github.com/shadowysphinx/opencode-unlimited-limit-bypass-/blob/main/src/proxy_chain.py) (Egress router), [`src/zen_guard.py`](https://github.com/shadowysphinx/opencode-unlimited-limit-bypass-/blob/main/src/zen_guard.py) (Quota watcher), [`src/zen_proxy.py`](https://github.com/shadowysphinx/opencode-unlimited-limit-bypass-/blob/main/src/zen_proxy.py) (Local proxy), [`src/avatar_ui.py`](https://github.com/shadowysphinx/opencode-unlimited-limit-bypass-/blob/main/src/avatar_ui.py) (Control dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["OpenCode workflow"]
  node_opencode(("OpenCode client"))
end

subgraph group_control["Control and recovery"]
  node_quota_guard["Quota watcher<br/>[zen_guard.py]"]
  node_resume["Session auto-resume<br/>[auto_resume.py]"]
  node_account_pool[("Account pool<br/>[account_pool.py]")]
  node_hop["Egress hop<br/>[zen_hop.py]"]
  node_dashboard["Control dashboard<br/>[avatar_ui.py]"]
  node_dashboard_ui["Dashboard interface<br/>[index.html]"]
end

subgraph group_egress["Egress routing"]
  node_local_proxy["Local proxy<br/>[zen_proxy.py]"]
  node_egress_router["Egress router<br/>[proxy_chain.py]"]
  node_warp_keeper["WARP keeper<br/>[warp_keeper.py]"]
  node_tor_manager["Tor manager<br/>[tor_manager.py]"]
  node_clean_endpoint["Clean endpoint<br/>[clean_endpoint.py]"]
end

subgraph group_relay["Relay capacity"]
  node_relay_server["Block relay<br/>[blockrelay.py]"]
  node_warpgate_pool[("WarpGate pool<br/>[warpgate_pool.py]")]
  node_lane["Lane selection<br/>[zen_lane.py]"]
end

subgraph group_support["Operations"]
  node_common["Shared network utilities<br/>[ouc_common.py]"]
  node_firewall["Firewall kill-switch<br/>[ouc_firewall.py]"]
  node_watchdog["Service watchdog<br/>[ouc_watchdog.py]"]
  node_doctor["Health diagnostics<br/>[doctor.py]"]
  node_branding["Desktop branding<br/>[desktop_brand.py]"]
end

node_upstream(("OpenCode service"))

node_opencode -->|"sends traffic"| node_local_proxy
node_local_proxy -->|"selects route"| node_egress_router
node_egress_router -->|"forwards requests"| node_upstream
node_quota_guard -->|"monitors logs"| node_opencode
node_quota_guard -->|"rotates egress"| node_egress_router
node_quota_guard -->|"requests resume"| node_resume
node_resume -->|"continues session"| node_opencode
node_dashboard -.->|"serves interface"| node_dashboard_ui
node_dashboard -->|"configures egress"| node_egress_router
node_dashboard -->|"controls guard"| node_quota_guard
node_warp_keeper -->|"maintains service"| node_local_proxy
node_warp_keeper -->|"checks mode"| node_egress_router
node_warp_keeper -->|"hands over"| node_tor_manager
node_egress_router -->|"uses Tor"| node_tor_manager
node_egress_router -->|"uses relay"| node_relay_server
node_relay_server -->|"leases instances"| node_warpgate_pool
node_lane -.->|"selects lane"| node_local_proxy
node_local_proxy -->|"tunnels traffic"| node_upstream
node_doctor -->|"checks route"| node_egress_router
node_doctor -->|"checks Tor"| node_tor_manager
node_firewall -->|"blocks direct egress"| node_opencode
node_branding -->|"updates desktop copy"| node_opencode
node_quota_guard -.->|"uses accounts"| node_account_pool
node_clean_endpoint -.->|"uses utilities"| node_common
node_watchdog -.->|"uses utilities"| node_common

click node_quota_guard "https://github.com/shadowysphinx/opencode-unlimited-limit-bypass-/blob/main/src/zen_guard.py"
click node_resume "https://github.com/shadowysphinx/opencode-unlimited-limit-bypass-/blob/main/src/auto_resume.py"
click node_account_pool "https://github.com/shadowysphinx/opencode-unlimited-limit-bypass-/blob/main/src/account_pool.py"
click node_hop "https://github.com/shadowysphinx/opencode-unlimited-limit-bypass-/blob/main/src/zen_hop.py"
click node_dashboard "https://github.com/shadowysphinx/opencode-unlimited-limit-bypass-/blob/main/src/avatar_ui.py"
click node_dashboard_ui "https://github.com/shadowysphinx/opencode-unlimited-limit-bypass-/blob/main/src/ui/index.html"
click node_local_proxy "https://github.com/shadowysphinx/opencode-unlimited-limit-bypass-/blob/main/src/zen_proxy.py"
click node_egress_router "https://github.com/shadowysphinx/opencode-unlimited-limit-bypass-/blob/main/src/proxy_chain.py"
click node_warp_keeper "https://github.com/shadowysphinx/opencode-unlimited-limit-bypass-/blob/main/src/warp_keeper.py"
click node_tor_manager "https://github.com/shadowysphinx/opencode-unlimited-limit-bypass-/blob/main/src/tor_manager.py"
click node_clean_endpoint "https://github.com/shadowysphinx/opencode-unlimited-limit-bypass-/blob/main/src/clean_endpoint.py"
click node_relay_server "https://github.com/shadowysphinx/opencode-unlimited-limit-bypass-/blob/main/relay/blockrelay.py"
click node_warpgate_pool "https://github.com/shadowysphinx/opencode-unlimited-limit-bypass-/blob/main/relay/warpgate_pool.py"
click node_lane "https://github.com/shadowysphinx/opencode-unlimited-limit-bypass-/blob/main/src/zen_lane.py"
click node_common "https://github.com/shadowysphinx/opencode-unlimited-limit-bypass-/blob/main/src/ouc_common.py"
click node_firewall "https://github.com/shadowysphinx/opencode-unlimited-limit-bypass-/blob/main/src/ouc_firewall.py"
click node_watchdog "https://github.com/shadowysphinx/opencode-unlimited-limit-bypass-/blob/main/src/ouc_watchdog.py"
click node_doctor "https://github.com/shadowysphinx/opencode-unlimited-limit-bypass-/blob/main/src/doctor.py"
click node_branding "https://github.com/shadowysphinx/opencode-unlimited-limit-bypass-/blob/main/src/desktop_brand.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_opencode toneBlue
class node_quota_guard,node_resume,node_account_pool,node_hop,node_dashboard,node_dashboard_ui toneAmber
class node_local_proxy,node_egress_router,node_warp_keeper,node_tor_manager,node_clean_endpoint toneMint
class node_relay_server,node_warpgate_pool,node_lane toneRose
class node_common,node_firewall,node_watchdog,node_doctor,node_branding,node_upstream toneIndigo
```

## Components

### OpenCode workflow

- **OpenCode client**

### Control and recovery

- [Quota watcher](https://github.com/shadowysphinx/opencode-unlimited-limit-bypass-/blob/main/src/zen_guard.py): `src/zen_guard.py`
- [Session auto-resume](https://github.com/shadowysphinx/opencode-unlimited-limit-bypass-/blob/main/src/auto_resume.py): `src/auto_resume.py`
- [Account pool](https://github.com/shadowysphinx/opencode-unlimited-limit-bypass-/blob/main/src/account_pool.py): `src/account_pool.py`
- [Egress hop](https://github.com/shadowysphinx/opencode-unlimited-limit-bypass-/blob/main/src/zen_hop.py): `src/zen_hop.py`
- [Control dashboard](https://github.com/shadowysphinx/opencode-unlimited-limit-bypass-/blob/main/src/avatar_ui.py): `src/avatar_ui.py`
- [Dashboard interface](https://github.com/shadowysphinx/opencode-unlimited-limit-bypass-/blob/main/src/ui/index.html): `src/ui/index.html`

### Egress routing

- [Local proxy](https://github.com/shadowysphinx/opencode-unlimited-limit-bypass-/blob/main/src/zen_proxy.py): `src/zen_proxy.py`
- [Egress router](https://github.com/shadowysphinx/opencode-unlimited-limit-bypass-/blob/main/src/proxy_chain.py): `src/proxy_chain.py`
- [WARP keeper](https://github.com/shadowysphinx/opencode-unlimited-limit-bypass-/blob/main/src/warp_keeper.py): `src/warp_keeper.py`
- [Tor manager](https://github.com/shadowysphinx/opencode-unlimited-limit-bypass-/blob/main/src/tor_manager.py): `src/tor_manager.py`
- [Clean endpoint](https://github.com/shadowysphinx/opencode-unlimited-limit-bypass-/blob/main/src/clean_endpoint.py): `src/clean_endpoint.py`

### Relay capacity

- [Block relay](https://github.com/shadowysphinx/opencode-unlimited-limit-bypass-/blob/main/relay/blockrelay.py): `relay/blockrelay.py`
- [WarpGate pool](https://github.com/shadowysphinx/opencode-unlimited-limit-bypass-/blob/main/relay/warpgate_pool.py): `relay/warpgate_pool.py`
- [Lane selection](https://github.com/shadowysphinx/opencode-unlimited-limit-bypass-/blob/main/src/zen_lane.py): `src/zen_lane.py`

### Operations

- [Shared network utilities](https://github.com/shadowysphinx/opencode-unlimited-limit-bypass-/blob/main/src/ouc_common.py): `src/ouc_common.py`
- [Firewall kill-switch](https://github.com/shadowysphinx/opencode-unlimited-limit-bypass-/blob/main/src/ouc_firewall.py): `src/ouc_firewall.py`
- [Service watchdog](https://github.com/shadowysphinx/opencode-unlimited-limit-bypass-/blob/main/src/ouc_watchdog.py): `src/ouc_watchdog.py`
- [Health diagnostics](https://github.com/shadowysphinx/opencode-unlimited-limit-bypass-/blob/main/src/doctor.py): `src/doctor.py`
- [Desktop branding](https://github.com/shadowysphinx/opencode-unlimited-limit-bypass-/blob/main/src/desktop_brand.py): `src/desktop_brand.py`

### Other components

- **OpenCode service**

## Connections

- OpenCode client → Local proxy: sends traffic (evidence: `README.md`)
- Local proxy → Egress router: selects route (evidence: `src/zen_proxy.py`)
- Egress router → OpenCode service: forwards requests (evidence: `README.md`)
- Quota watcher → OpenCode client: monitors logs (evidence: `src/zen_guard.py`)
- Quota watcher → Egress router: rotates egress (evidence: `src/zen_guard.py`)
- Quota watcher → Session auto-resume: requests resume (evidence: `src/zen_guard.py`)
- Session auto-resume → OpenCode client: continues session (evidence: `src/auto_resume.py`)
- Control dashboard → Dashboard interface: serves interface
- Control dashboard → Egress router: configures egress (evidence: `src/avatar_ui.py`)
- Control dashboard → Quota watcher: controls guard (evidence: `src/avatar_ui.py`)
- WARP keeper → Local proxy: maintains service (evidence: `src/warp_keeper.py`)
- WARP keeper → Egress router: checks mode (evidence: `src/warp_keeper.py`)
- WARP keeper → Tor manager: hands over (evidence: `src/warp_keeper.py`)
- Egress router → Tor manager: uses Tor (evidence: `src/proxy_chain.py`)
- Egress router → Block relay: uses relay (evidence: `src/proxy_chain.py`)
- Block relay → WarpGate pool: leases instances (evidence: `relay/blockrelay.py`)
- Lane selection → Local proxy: selects lane (evidence: `src/zen_lane.py`)
- Local proxy → OpenCode service: tunnels traffic (evidence: `src/zen_proxy.py`)
- Health diagnostics → Egress router: checks route (evidence: `src/doctor.py`)
- Health diagnostics → Tor manager: checks Tor (evidence: `src/doctor.py`)
- Firewall kill-switch → OpenCode client: blocks direct egress (evidence: `src/ouc_firewall.py`)
- Desktop branding → OpenCode client: updates desktop copy (evidence: `src/desktop_brand.py`)
- Quota watcher → Account pool: uses accounts (evidence: `src/zen_guard.py`)
- Clean endpoint → Shared network utilities: uses utilities (evidence: `src/clean_endpoint.py`)
- Service watchdog → Shared network utilities: uses utilities (evidence: `src/ouc_watchdog.py`)
