fix(proxy): thread-anchor guard on threads responses + honest tool:response success - #407
Merged
Merged
Conversation
…sponse success - ProxyManager only captures threads[0] as currentThreadId when no thread is anchored yet, so list_threads and internal thread polls no longer retarget stackTrace/scopes/evaluate away from the stopped thread (#396) - The tool:response log line mirrors the tool payload's own success boolean instead of hardcoding true (#397); logging-format spec synced Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #396
Fixes #397
Two small correctness/telemetry fixes from the attach-hardening follow-ups.
#396 — ProxyManager no longer clobbers
currentThreadIdwiththreads[0]handleDapResponsecaptured a thread id from every successfulthreadsresponse, unconditionally overwriting the id anchored by astoppedevent. Anylist_threadscall (or internal threads poll — the attach verify loop, the stack-readiness scan, pause discovery) landing while paused on a non-first thread silently retargeted subsequentstackTrace/scopes/evaluatetothreads[0].The capture now only fires when no thread id is known (
currentThreadId == null), preserving the fallback for adapters that omitthreadIdfrom stopped events.threadsresponse listing[1, 12]no longer retargets to 1.threads[0]) still passes unchanged.stoppedalready, so no core divergence.#397 —
tool:responselog line reports the payload's ownsuccessThe structured
tool:responseline hardcodedsuccess: true(meaning "the handler didn't throw"), directly contradicting payloads like a failedattach_to_processthat return{ success: false }without throwing — actively misleading during triage and hiding failure rates from log-based metrics.extractPayloadSuccess()now parses the first text content entry and mirrors its booleansuccesswhen present; payloads without one (or non-JSON) still logsuccess: true.tool:error(thrown path) is unchanged.tool:responsecarriessuccess: falsefor a failing attach payload andsuccess: truefor a successful one.docs/logging-format-specification.mdupdated: documents the newsuccesssemantics and drops theresponsefield that was never actually emitted.Verification
npx vitest run tests/unit/proxy/ tests/core/unit/server/— 37 files, 663 tests passnpm testgreennpm run lintclean🤖 Generated with Claude Code