fix: #7 Private-Proxy-Modus mit Reconnect und Verbindungsübernahme implementieren #25
No reviewers
Labels
No labels
agent:done
agent:ready
agent:working
area/browser
area/cli
area/http
area/mcp
area/media
area/observability
area/proxy
area/security
area/testing
area/tunnel
priority/P0
priority/P1
priority/P2
type/chore
type/design
type/docs
type/epic
type/feature
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
ai-tools/private-proxy-mcp!25
Loading…
Reference in a new issue
No description provided.
Delete branch "agent/issue-7-private-proxy-modus-mit-reconnect-und-ve"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
goaway(replaced)umgesetzt.Alle Änderungen sind in vier Commits gepusht.
go test -race ./...sowie wiederholte Reconnect-/Tunnel-Tests sind erfolgreich; der Worktree ist sauber.Ich prüfe die aktuelle Branch-Implementierung gegen die Akzeptanzkriterien und ergänze gezielt fehlende Lifecycle- oder Testabdeckung.Die vorhandenen Tests decken die Kernfälle ab; ich führe sie nun mit isolierten Build-Caches aus und prüfe Konfigurations- sowie Shutdown-Randfälle.Die vollständige Suite und der Race-Check bestehen. Die Branch enthält keine uncommitteten Änderungen; alle Issue-7-Änderungen sind bereits als thematische Commits vorhanden.PR_TITLE: feat(proxy): add resilient private proxy connector
PR_BODY:
Implements private-proxy upgrade, TLS, reconnect/backoff, ping/pong, connection takeover, and graceful draining shutdown.
Verified:
go test -race ./...Alles Implementiert
Closes #7
🚧 WIP pull request opened — linked to issue #7. Agent is working…
💭 Agent progress
Planning concise PR commentary
Ich prüfe zuerst CLI-, Handshake- und Tunnel-Lifecycle-Struktur sowie bestehende Tests. Danach implementiere ich den Proxy in kleinen, separat getesteten Commits und pushe jeden Commit direkt.
💭 Agent progress
Separating commands to avoid chain stopping
💭 Agent progress
Assessing private-proxy architecture conflict
💭 Agent progress
Designing private-proxy client package
Planning private-proxy client config defaults
Refining private client ping-pong handling
Planning runtime connection loop and TLS handling
Defining reconnect backoff and ping timeout logic
Designing session and request handler interfaces
Planning session request completion method
Designing connector config with TLS and timing
Die bestehende
private-proxy-CLI startet fälschlich den öffentlichen Upgrade-Listener. Ich trenne dessen Listener-Konfiguration von der ausgehenden Proxy-Konfiguration und ergänze validierte TLS-, Handshake-, Liveness- und Backoff-Parameter.💭 Agent progress
Planning CLI and client package refactor
Retaining deprecated ListenAddress for compatibility
Designing connection handling with backoff and shutdown
Designing connection read deadline handling
Extending session with request handling and cancellation
Implementing synchronous request completion and liveness handling
💭 Agent progress
Fixing string imports and session event handling
Verifying context closure and fixing header utilities
💭 Agent progress
Configuring temporary Go build cache
💭 Agent progress
Planning tests and reviewing bugs
Designing connector.Listener ownership
Refining Listener pointer API and registry handling
Implementing server session loop with ping-pong handling
Refining connection replacement and locking strategy
Adding client outbound tests with backoff and upgrade checks
💭 Agent progress
Refactoring retry logic with net.Pipe and context cancellation
💭 Agent progress
Removing unused Connector struct and config
💭 Agent progress
Completing commit push
Der ausgehende Client ist jetzt verdrahtet: HTTP/1.1-Upgrade, verifiziertes TLS mit optionaler CA/Servername-Überschreibung, explizite Entwicklungs-Ausnahmen, secret-sichere Fehler sowie jitternder, begrenzter Reconnect-Backoff sind getestet.
💭 Agent progress
Planning listener takeover and liveness test
Designing managed connection takeover and shutdown
Planning connection takeover tests with net.Pipe
Implementing listener for restart simulation
Als Nächstes ergänze ich die serverseitige exklusive Sitzungsübernahme: Eine neu authentisierte Verbindung sendet der alten
goaway(replaced), schließt sie vor Aktivierung des neuen Consumers und beantwortet Tunnel-Pings. Der Listener schließt dabei auch hijackte Verbindungen beim Shutdown.💭 Agent progress
Analyzing deadlock and timeout behavior
Designing integration tests for connection handling
💭 Agent progress
Analyzing serveUpgrade buffering and timeout behavior
Instrumenting ping test with error channel
💭 Agent progress
Analyzing ping-pong timeout behavior
💭 Agent progress
Analyzing client read timeout behavior
Planning buffered reader timeout fix
Ensuring connection closure on session return
Designing read goroutine with timers
Refactoring writer timeout parameters
💭 Agent progress
Checking network error handling usage
💭 Agent progress
Evaluating goroutine channel deadlock risk
Planning request completion and graceful drain
Fixing session completion after write errors
Inspecting test name suffixes
💭 Agent progress
Removing unused event parameter
💭 Agent progress
Running tests with race detector
💭 Agent progress
Implementing wait via functions.wait
Reconnect nach Netzabbruch und zwischenzeitlich nicht verfügbarem Server sowie Ping/Pong sind jetzt als Integrationsabläufe abgedeckt. Die Tests prüfen außerdem, dass Authentisierungsfehler retried werden und der Shared Key nicht in Logs erscheint.
Committing and pushing changes
💭 Agent progress
Planning graceful shutdown implementation
Refining drain timeout and config usage
Implementing capped backoff jitter
Refining session drain and timeout handling
Implementing session abort and drain with validation
Für den Shutdown ergänze ich jetzt die fehlende Deadline-Nutzung:
goaway(shutdown)wird innerhalb des Drain-Budgets geschrieben, aktive Tunnelkontexte werden bis zur Deadline abgewartet und anschließend garantiert abgebrochen. Parallel härte ich die Backoff-Obergrenze gegen Jitter und Duration-Overflow.💭 Agent progress
Planning shutdown tests and README updates
💭 Agent progress
Hardening duration jitter calculation
Simplifying jitter zero testing
💭 Agent progress
Fixing flaky shutdown synchronization
Identifying missing deadline enforcement in Receive context
💭 Agent progress
Preparing commit push
Der Shutdown sendet nun
goaway(shutdown), nutzt die konfigurierte Drain-Deadline und bricht verbleibende Request-Kontexte deterministisch ab. Race-Tests und zehnfache Wiederholung der Reconnect-, Takeover- und Shutdown-Tests laufen fehlerfrei.💭 Agent progress
Auditing concurrency and deadlock risks
Verifying handler concurrency and TLS reload
Identifying potential unlimited header size issue
Designing handshake byte-limit wrapper
Implementing upgrade response header validation
Adding single-value header validation
Implementing header max reader and tests
Beim abschließenden Protokoll-Audit härte ich noch die Upgrade-Antwort: maximal 32 KiB Header, exakt eine ausgewählte Upgrade-/Wire-Version und keine Body-Framing-Header bei
101. Gepufferte erste Tunnelbytes bleiben dabei erhalten.💭 Agent progress
Verifying readUpgradeResponse behavior with buffer limits
💭 Agent progress
Preparing commit for push
💭 Agent progress
Preparing final tests and update plan
🔍 Verifying implementation (attempt 1/3)
💭 Agent progress
goaway(replaced)umgesetzt.Alle Änderungen sind in vier Commits gepusht.
go test -race ./...sowie wiederholte Reconnect-/Tunnel-Tests sind erfolgreich; der Worktree ist sauber.Planning code review with git tools
Ich prüfe die aktuelle Branch-Implementierung gegen die Akzeptanzkriterien und ergänze gezielt fehlende Lifecycle- oder Testabdeckung.
💭 Agent progress
Inspecting command chaining use
💭 Agent progress
Planning client and config parsing
💭 Agent progress
Identifying config flag and connection handling issues
Examining serveSession deadlock and config validation gaps
Planning environment-based cache workaround
Die vorhandenen Tests decken die Kernfälle ab; ich führe sie nun mit isolierten Build-Caches aus und prüfe Konfigurations- sowie Shutdown-Randfälle.
💭 Agent progress
Planning to read config tests
💭 Agent progress
Identifying Config and Integration Testing Issues
Reviewing signal handler coverage
💭 Agent progress
Verifying connection takeover logic
Investigating GoAway session drain handling
💭 Agent progress
Planning incremental commits and git diff checking
💭 Agent progress
Verifying open todo implementation
Die vollständige Suite und der Race-Check bestehen. Die Branch enthält keine uncommitteten Änderungen; alle Issue-7-Änderungen sind bereits als thematische Commits vorhanden.
✅ Verify OK — agent reported Alles Implementiert
WIP: #7 Private-Proxy-Modus mit Reconnect und Verbindungsübernahme implementierento fix: #7 Private-Proxy-Modus mit Reconnect und Verbindungsübernahme implementieren✅ forge agent finished implementation
fix(proxy): bound upgrade response parsingAgent output (tail)
⚠️ Merge conflict detected (attempt 1/3)
Re-running coding agent to merge/rebase and resolve conflicts…
💭 Agent progress
Planning final PR formatting and output
Designing precise PR title and body output
Implements private-proxy upgrade, TLS, reconnect/backoff, ping/pong, connection takeover, and graceful draining shutdown.
Verified:
go test -race ./...Assessing GitHub PR conflict and commentary needs
I’ll merge the current
maininto the PR branch, resolve conflicts while preserving both changesets, then commit and push the resolution.💭 Agent progress
The PR branch is clean and tracks its remote; I’m checking the base branch state before applying the merge.
💭 Agent progress
Escalating fetch permission request
💭 Agent progress
Inspecting diff before merging
mainhas advanced through PR #24; I’m merging it into the reconnect branch and will resolve any overlapping HTTP/tunnel changes.Planning precise git merge commands
💭 Agent progress
Planning listener merging strategy
💭 Agent progress
Planning session merging and API adjustments
💭 Agent progress
Planning conflict resolution via patch application
Designing complete listener implementation and patch
The conflicts overlap connection ownership with request execution. I’m retaining single-active-session takeover and shutdown draining, while carrying forward bounded HTTP execution, cancellation, and frame-safe responses from
main.💭 Agent progress
Planning test patch application
Reviewing session conflict markers
💭 Agent progress
Removing duplicate method from conflict patch
💭 Agent progress
Planning targeted conflict resolution
💭 Agent progress
Planning conflict resolution for listener_test
Inspecting head details
💭 Agent progress
Fixing patch markers and syntax
💭 Agent progress
Verifying gofmt test markers
💭 Agent progress
Verifying escalated prefix with tests
All conflict markers are removed. The merged implementation now serializes lifecycle writes through the managed connection and aborts in-flight HTTP work when a session is replaced or closed; I’m running the full Go suite.
💭 Agent progress
Fixing API integration artifact
💭 Agent progress
Adjusting client to boolean type
💭 Agent progress
Planning test implementation
The merge exposed one caller still using the superseded request-completion signature; it now handles the completion race explicitly.
💭 Agent progress
Planning incremental commit and push
go test ./...now passes. I’m staging the resolved merge and the compatibility adjustment as one integration commit.💭 Agent progress
Planning external commit
💭 Agent progress
Preparing immediate push
🛠️ Pushed merge-conflict fix (attempt 1/3). Re-checking mergeability…
I’ll merge the current
maininto the PR branch, resolve conflicts while preserving both changesets, then commit and push the resolution.The PR branch is clean and tracks its remote; I’m checking the base branch state before applying the merge.mainhas advanced through PR #24; I’m merging it into the reconnect branch and will resolve any overlapping HTTP/tunnel changes.The conflicts overlap connection ownership with request execution. I’m retaining single-active-session takeover and shutdown draining, while carrying forward bounded HTTP execution, cancellation, and frame-safe responses frommain.All conflict markers are removed. The merged implementation now serializes lifecycle writes through the managed connection and aborts in-flight HTTP work when a session is replaced or closed; I’m running the full Go suite.The merge exposed one caller still using the superseded request-completion signature; it now handles the completion race explicitly.go test ./...now passes. I’m staging the resolved merge and the compatibility adjustment as one integration commit.Mergedmaininto PR #25 and pushed8c6728a.Preserved connection takeover/draining alongside bounded HTTP execution and cancellation.
go test ./...passes.