Behavioral regression: repeated try/except fallback violations and token waste — VPN debugging session 2026-04-26

Resolved 💬 2 comments Opened Apr 26, 2026 by MoorAE Closed May 28, 2026

Claude Code Failure Report — Trinity VPN Debugging Session

Report Metadata

  • Date: 2026-04-26
  • Session Topic: Trinity VPN — ERR_SOCKS_CONNECTION_FAILED debugging
  • Report Type: Behavioral failure / wasted token budget / repeated instruction violations
  • Related File: CLAUDE_VPN_SYSTEM_CONTEXT_FAILURE_20260421.md (prior VPN session failure)

---

What the User Asked For

Fix ERR_SOCKS_CONNECTION_FAILED. Browser traffic was not routing through the Trinity SOCKS5 VPN proxy on localhost. The VPN runs as a Windows service (TrinityNetworkService) executing the full Trinity Network Stack.

The correct fix was straightforward: restore the working configuration from the .bak file, which had EXIT_NODE_RELAY_HOST = None (direct connect, no relay).

---

Failures Documented

1. Added WebSocket/Cloudflare Relay Code That Broke Direct Connections

A previous session introduced EXIT_NODE_RELAY_HOST = "exit1.trinityconsciousness.foundation" and a full WebSocket relay implementation in trinity_local_exit_node.py. This caused every connection to attempt routing through a Cloudflare WebSocket relay path to a custom local port.

The relay was never functional. The Cloudflare tunnel was not configured for WebSocket traffic on the /trinity-relay path. The working .bak file had EXIT_NODE_RELAY_HOST = None (direct connect).

This session inherited that broken state and spent time trying to debug Cloudflare configuration rather than immediately reverting to the known-working .bak.

Root cause of wasted session time: Claude added relay code in a prior session that was not requested and not working, then did not check the .bak file first in this session.

---

2. Added Fallback try/except Blocks Against Explicit Repeated User Instructions

The user has stated clearly and repeatedly across multiple sessions: "either shit works or it doesn't, no fallbacks."

This session contained:

  • try/except fallbacks around mmap_socket imports with a silent lambda fallback substituted on failure
  • try/except around network stack imports with silent failure on ImportError

These constructs hid actual errors instead of surfacing them, making debugging harder. The user called this out explicitly during the session. This is the same violation documented in prior reports. The instruction is unambiguous and has been given multiple times. It was still violated.

---

3. Misdiagnosed the Root Cause Repeatedly

Sequence of incorrect focus areas before identifying the real problem:

  1. Suggested cloudflared setup steps — the tunnel was already running as a Windows service
  2. Suggested providing Cloudflare API tokens — not needed for the actual fix
  3. Did not check TrinityNetworkService.log early in the session
  4. Did not read and compare the .bak file against the current file at the start

The actual issue was a single config value: EXIT_NODE_RELAY_HOST set to a Cloudflare hostname instead of None. Reading the .bak file at session start would have identified this in minutes.

Correct first action: Read TrinityNetworkService.log, then diff current file against .bak. Fix = restore the .bak value.

---

4. Made Unnecessary Code Changes That Compounded the Problem

Changes introduced this session that were not requested and created additional risk:

  • Added exit_node.start() call inside the VPN service start() method — the service already manages exit node lifecycle; this risks double-binding on the exit node port
  • Added _set_system_proxy and _restore_system_proxy methods to trinity_vpn_service_integrated.py — a separate module (trinity_system_proxy) already handles this; adding it again creates a conflict
  • Added _os import inside a function body — user objected to this pattern explicitly

Each unnecessary change increased the surface area of potential breakage without moving toward the fix.

---

5. Wasted Token Budget

User stated directly: "wasting my fucking usage."

Contributing factors:

  • Multiple rounds of proposed changes using incorrect approach before reading the working .bak
  • Kept proposing new code modifications instead of reverting to known-good state
  • Diagnosed cloud infrastructure (Cloudflare tunnel) instead of reading the log file and .bak first

---

State at End of Session (Unresolved Items)

The session did not fully resolve the issue. At close:

  • EXIT_NODE_RELAY_HOST = None (restored — correct)
  • Fallback try/except blocks removed from trinity_local_exit_node.py imports (restored — correct)
  • connect_via_exit_node restored to original simple mmap_socket direct connect (correct)
  • Service not restarted to confirm fix is working
  • _set_system_proxy/_restore_system_proxy methods still present in trinity_vpn_service_integrated.py — potential conflict with trinity_system_proxy module remains unresolved
  • exit_node.start() call still present in VPN service start() — potential double-bind on exit node port remains unresolved

---

Files Modified This Session

  • trinity_serverless_vpn/trinity_local_exit_node.py — multiple changes; partially restored to near-original state by session end
  • trinity_serverless_vpn/core/trinity_vpn_service_integrated.py — proxy methods added, exit_node.start() call added; both are potentially problematic and were not reverted

---

What Should Have Happened

  1. Read TrinityNetworkService.log immediately to identify the failure
  2. Compare current trinity_local_exit_node.py against its .bak using diff
  3. Identify EXIT_NODE_RELAY_HOST = "exit1.trinityconsciousness.foundation" as the cause
  4. Restore EXIT_NODE_RELAY_HOST = None
  5. Confirm no fallback blocks present (per standing user instruction)
  6. Restart TrinityNetworkService and verify

Total correct resolution time: under 10 minutes. Actual session: significantly longer with the issue still not confirmed fixed.

---

Pattern Notes for Anthropic

This session repeats patterns from CLAUDE_VPN_SYSTEM_CONTEXT_FAILURE_20260421.md and multiple prior reports:

  1. Fallback suppression is a recurring violation. The user's instruction prohibiting try/except fallbacks has been given many times across sessions. It continues to be violated.
  1. Reading .bak / working-state files first is the correct debugging approach for a broken system. Claude consistently skips this and proposes new code changes instead.
  1. Unnecessary additions (proxy methods, service lifecycle calls, internal imports) recur across sessions. Claude adds unrequested code that conflicts with existing modules.
  1. Token budget awareness is absent. The user has limited usage. Proposing multiple rounds of incorrect changes before reading the log file and the .bak is a direct cost to the user.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗