revert(proxy): drop overfit Caido reconnect/HTTPQL band-aids, keep serialization lock#799
Conversation
…rialization lock Followup to #794. The error-string-matching reconnect logic and injected HTTPQL error hints overfit to specific past error messages without solving the underlying problem, so revert both proxy files to their pre-#794 shape and keep only the real concurrency fix: - caido_api: keep the asyncio lock that serializes access to the non-concurrency-safe Caido GraphQL transport (call_with_client), drop the connection-error markers, _is_connection_error, reconnect/idempotent retry, and SharedCaidoClient. - tools: revert to the raw context client; serialize host-side calls through a module-level lock. Drop the _HTTPQL_HINT / _is_httpql_error / _httpql_error injection (HTTPQL syntax already lives in the list_requests docstring). - runtime: bootstrap_caido returns just the client again; drop reconnect_caido and the project-id plumbing in session_manager/runner. - prompt: add a concise HTTPQL syntax note to the proxy section of the system prompt, where this guidance belongs. - tests: trim to the surviving caching + serialization guarantees.
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Greptile SummaryThis PR removes the Caido reconnect and runtime HTTPQL hint workarounds while keeping request serialization. The main changes are:
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (2): Last reviewed commit: "fix(proxy): close Caido client if projec..." | Re-trigger Greptile |
Addresses Greptile P1: when connect() succeeds but project create/select fails, the connected client never reaches the session bundle, so close it on the failure path to avoid leaking the transport.
|
Thanks for the review. P1 (bootstrap client leak) — fixed in 4b07166: Teardown race (close_client outside the serialization lock) — leaving as-is. This is pre-existing behavior, not introduced by this PR (this is a revert of #794 back to the prior shape), and coordinating session teardown with in-flight proxy calls is a separate, more involved change that's out of scope for this revert. Happy to track it separately if wanted. |
✅ Live proxy-function testing passedExercised every Function coverage — all PASS
Revert behavior verified
Concurrency — the serialization fix works
Testing via Devin: https://app.devin.ai/sessions/5453b8e1865246cca776e31159dd9a02 |
Summary
Followup to #794. Most of what #794 added to
strix/tools/proxy/{tools,caido_api}.pyoverfit to specific past error messages rather than fixing anything: a reconnect path that matched on substrings like"transport is already connected"/"connector is closed", and an injected HTTPQL "hint" gated on"httpql" in str(exc). This reverts both files to their pre-#794 shape and keeps only the one real fix — serializing access to the non-concurrency-safe Caido GraphQL transport.Kept (real concurrency fix): the
asynciolock. Two in-flight requests on the shared client race and raise "Transport is already connected", so all proxy calls run one at a time.caido_api.call_with_clientstays, reduced to pure serialization:tools.pyserializes through a module-level_CAIDO_CALL_LOCKvia a small_call(client, fn)helper.Dropped (overfit / redundant):
_CONNECTION_ERROR_MARKERS,_is_connection_error,_safe_aclose, the reconnect +idempotent=retry, andSharedCaidoClient.reconnect_caidoand the project-id plumbing —bootstrap_caidoreturns just theClientagain;session_manager/runnerstore the raw client._HTTPQL_HINT/_is_httpql_error/_httpql_error. The HTTPQL syntax it injected is already documented in thelist_requestsdocstring.Moved to the prompt (where it belongs): a concise HTTPQL syntax note added to the PROXY section of
system_prompt.jinja(quote strings, unquoted ints,AND/ORwith noNOT, operator-by-field-type), instead of surfacing it as a runtime error hint.Tests:
tests/test_proxy_client.pytrimmed to the surviving guarantees — client caching, error propagation, and serialization on both thecall_with_clientand host_callpaths.Net:
+86 / −438across 7 files.Link to Devin session: https://app.devin.ai/sessions/5453b8e1865246cca776e31159dd9a02
Requested by: @0xallam