Repository navigation
podbench vscode actually debugs - #214
Merged
Merged
Conversation
`editor_limit` computed its target as the shortfall of EDITOR_HEADROOM against *live* free memory, rounded up to the next GiB - and live free memory is what the editor is consuming. Every reconnect therefore sized the pod from the consequences of the last one: measured 2026-08-24, two `podbench vscode` runs against one pod took it 1Gi -> 2Gi, and a third would have gone again. `vscode` is the only verb that resizes a pod nobody asked it to, which makes a non-idempotent target the worst place for one. EDITOR_LIMIT is a constant, so a second run is a no-op by construction, and 6Gi is a number a reader can check against the 1215 MiB the editor actually costs. EDITOR_HEADROOM is untouched: it still decides whether a resize is needed at all and it is still what the warning quotes - only the target stops being arithmetic. A current limit already at or above the constant answers None rather than a reduction, so a generously sized container is never shrunk to make room for an editor. `--resize MEMORY` still wins; it is what makes a flat default defensible, and it now has a test saying so. The three how-to and reference passages that described the shortfall are corrected in the same commit, because a docs build cannot catch prose that is merely no longer true. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WAGABUogwWJ68k1Dh28ZBS
UNREACHABLE_CAUSES is interpolated only into check_reachable's refusal, which is reached only through open_seat from the vscode verb; attach never prints it. Two of its four bullets nonetheless offered `podbench attach --new`, including the one that fires in the field, so a reader who had just run `podbench vscode` was told to go and run something else. `--new` is spelled the same on both verbs, so dropping the verb is correct wherever this prints and costs nothing: naming the verb that was actually run would mean threading the invoked name from the launcher into a module-level constant for one word. The launcher's _KEY_REMEDY_SEAT already reached the same wording from the same constraint, and it is left alone. This is the string and nothing else. An ephemeral container's authorized_keys is immutable, so the last bullet is still describing the only way the key can change, and podbench still does not try to mutate it; the constant's new docstring records that so the next reader does not take the bullet as a TODO. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WAGABUogwWJ68k1Dh28ZBS
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
PROVISION_DEST is /opt/podbench-debugpy, and on the beamline pod measured on 2026-08-24 that directory is drwxr-xr-x root root while the degraded seat is uid 37887 with an empty effective set. The install is refused by ordinary file permissions, and everything downstream of it follows: no importable debugpy, no configurations, no launch.json, and no debug adapter installed into the seat either. Pointed at the claim instead, every step succeeded. So the destination is chosen from the pod before anything is written. The claim is the right answer there and not a workaround: it is the same inode at the same path in both mount namespaces, which is what gdb-across-namespaces demands, it is writable without being root, and it is a volume. It is chosen from the seat's own volumeMounts rather than from is_hotfixed, for editor_folder's reason - a pod can carry the layout while this seat carries no mount, and the property being relied on is gone there. There is no fallback in either direction: a destination that changed after a refusal turns a permissions bug into a mystery about which path is live. The report names the one that was chosen, beside the line that already names where the claim was mounted. The refusal message stops assuming the seat is root as well. It opened by ruling out the target's file modes on the strength of CAP_DAC_OVERRIDE and sent the reader to PTRACE_MODE_READ and LSMs - correct on the full rung, and on the degraded one it excluded the entire cause. The seat now reads its own /proc/self/status and branches on it. One caveat was half-false as a result and is reworded rather than left: on a PVC the install survives a container restart while the injection still does not. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WAGABUogwWJ68k1Dh28ZBS
This was referenced Aug 24, 2026
On a hotfixed pod `podbench vscode` opens the claim - the application's own checkout - and a real project ships all four .vscode/*.json committed. Measured 2026-08-24 on bl47p-ea-fastcs-01-0: both merges refused, launch.json on the // comments VS Code's own scaffold writes and settings.json on a trailing comma before }. Both files are valid JSONC. That is the common case there, not an edge case, and it is fatal on its own - no launch.json means no F5 however well everything upstream of it works. So read JSONC. The obvious follow-on - parse the dialect, then json.dumps the result - would be a worse outcome than the refusal it replaces: these are the user's committed files, and they would come back reformatted with their comments gone. Parsing is therefore for deciding only, and every write is a textual edit of the spans podbench owns. The bridge's shim reached the same shape for the same reason. New members go in after the opening brace rather than at the end, which is not taste: appending has to put a comma after the last value, and where a // comment trails that line the comma lands inside the comment and the file stops parsing. Arrays are still appended to, because order is meaning there, but the comma goes immediately after the last item's value for the same reason. extensions.json goes through it too. The plan named the two merges it had measured; the fourth committed file in that directory has the same defect for the same reason, and fixing three of four would have been arbitrary. No new dependency - typer is still the whole runtime list, and the scanner is ~200 lines against json.raw_decode for scalars, which is also what keeps a // or a comma inside a string literal from ever being seen as syntax. Text that is not JSONC either still raises, with json's own wording, so the sentence a user is shown is unchanged. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WAGABUogwWJ68k1Dh28ZBS
`--provision`'s success line was returned whenever the injector subprocess exited 0. Measured on 2026-08-24 against the hotfixed bl47p-ea-fastcs-01-0, that exit code was 0, the port was open and in LISTEN, and a debug session still could not start: the adapter accepted the TCP connection and never answered `initialize` (15s, 0 bytes). So podbench claimed a working debugger from evidence that does not support one, and the redo's criticism tightens to "an open port is not proof either". inject_debugpy now finishes by asking the adapter the first question VS Code asks it, over a loopback socket in the pod's own network namespace, and reports what came back as four distinct sentences rather than one. Only an answered `initialize` is a success line; an open port that says nothing names the half that is established (the injection ran, the port is open) and the half that is not (no session of any kind), which is the state the live target was in. The handshake closes its socket without sending a DAP `disconnect`: the adapter serves one client, and disconnect_request calls stop_serving(), which would close the listener this probe exists to prove. Bounded at five seconds - the injection itself cost 8.7s and the wedged adapter answered nothing in fifteen, so a longer bound only reproduces the hang. Injected.ok stays the injector's verdict rather than the proof's, because the caller re-probes for a listener on that basis and would otherwise print "nothing is listening" over a port that genuinely is open - the same class of untrue sentence this commit exists to remove. The client is a new stdlib module, testable on its own against a loopback server the suite owns, and reaches inject_debugpy through an injected seam so no unit test opens a socket to anything it does not control. One runtime dependency, and it is still the CLI. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WAGABUogwWJ68k1Dh28ZBS
Slice 5 of the plan, and the answer is in two halves that must not be run together. Named and measured: the redo's section 4 misread the mechanism. `--for-server <n>` is the *debuggee's* transient endpoints listener - debugpy's api.listen binds it, hands the port to the adapter it spawns, accepts one connection carrying the endpoints, and closes it in the finally about a second in. It is not the adapter's server-facing port. So its absence from the socket table is the normal state of a healthy adapter, and so is "three socket fds": client listener, server listener, accepted server connection. Both observations were reproduced here on sessions that attach and enumerate threads. `initialize` is also answered by the adapter locally, out of a capability table, without consulting the debuggee - so it could never have been diagnostic of a missing debuggee half in the first place. Driven through podbench's own --provision against a virgin pid, with no instrumentation and no hand-fixes, the whole chain works: the target logs `pydevd is connected to adapter at 127.0.0.1:41095`, `initialize` answers in 0.00s, `attach` in 4.00s, and `threads` returns the application's four. Still not measured, and stated as such: why the redo's client got zero bytes. It did not reproduce in six attempts, four of them deliberate wedges. The evidence that would have settled it is gone - podbench-home is an emptyDir, so that seat's vscode-server and extension-host log died with the pod. Two candidates are recorded as candidates: the redo's own hand-rolled client's framing, and the VS Code side alone, which this run could not test because driving VS Code needs the GUI. Both candidates the plan named are ruled out by measurement rather than by argument: hostNetwork's 127.0.0.1 (the ESTABLISHED pair is in the shared netns table) and the gdb-across-namespaces interpreter split (the debugpy tree is the claim's, one inode on both sides, and the adapter is spawned by the target's own interpreter). The superseded section of the earlier file gets a pointer at its head, so the next reader does not re-derive the inference this one falsifies. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WAGABUogwWJ68k1Dh28ZBS
This was referenced Aug 24, 2026
Closed
Slice 6, and the plan's last one: one run, one seat, no hand-fixes. Five of the six checks pass, and the sixth is a limitation of the bridge rather than of the seat. launch.json's diff against fastcs-example's committed file is purely additive - zero removed lines, four `//` comments and the trailing comma intact - which is slice 3's falsification condition stated as a property and then measured. ms-python.debugpy 2026.6.0 is in the seat. A breakpoint in controllers.py binds and is hit at update_voltages:99 with the workload's own controller, index and self in scope, is continued, and is hit again with fresh frame ids - which also proves the pathMappings. The memory limit is 6Gi after the second run and 6Gi after the third, with no resize attempted on either, which is slice 1's idempotence on a real pod. restartCount is 0 on both application containers throughout. The dap.* events are absent because the bridge's tracker runs in the laptop's extension host while this adapter runs in the seat's. The session itself is measured by every other check in that row. Phase 8's open thread is closed. The seat's ms-python.debugpy log goes one line past where the redo's stopped - `Received 'debugpySockets' event` after `Connecting to DAP Server` - beside an ESTABLISHED pair on the port and a fourth socket fd on the adapter. Slice 5b's one unmeasured assumption is measured too: podbench probed the port and closed without a DAP disconnect, and VS Code then attached to that same port and hit a breakpoint, so the probe does not burn the adapter. Two defects the run found are filed rather than fixed here, because both are outside this plan. The first `vscode` resized the pod and then lost a 409 adding its own ephemeral container, landing no seat and saying nothing about the resize it had just made - #136, reproduced on `vscode` and made more reachable by the flat 6Gi, commented there. Re-provisioning a pid that already serves debugpy exits 0, starts nothing, and rewrites launch.json's live port with a dead one - #218, newly visible because 5b's handshake correctly printed the refusal a success line used to hide. An explained retry is still a retry, so run 1 is recorded as a fail. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WAGABUogwWJ68k1Dh28ZBS
gilesknap
marked this pull request as ready for review
August 24, 2026 10:05
This was referenced Aug 24, 2026
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.
Executes
.claude/plans/vscode-actually-debugs.md, the successor tohotfix-becomes-easy-to-drive.md— which ended by naming two field failuresrather than fixing them. Every claim below has a measurement behind it in
.claude/evidence/phase7-vscode-and-the-two-failures.md(the 2026-08-24 redo,against a genuinely hotfixed
bl47p-ea-fastcs-01-0on p47).Failure 2 — "debugging does not start" — is not one defect. On a hotfixed pod it
is a cascade with three independent links, each fatal on its own:
Slices
1 — a fixed editor limit, because the current one ratchets.
Fixes #166.Measured: two
podbench vscoderuns against one pod took its limit1Gi -> 2Gi, because the target was computed from live free memory and
live free memory is what the editor is consuming. Replaced with a flat
EDITOR_LIMITof 6Gi;EDITOR_HEADROOMstill decides whether, and--resizestill wins. A pod already above it is never shrunk.4 — failure 1 is a message, and only a message.
UNREACHABLE_CAUSESis reached only from the
vscodeverb, yet two of its four bullets toldthe reader to run
podbench attach --new. Now names the flag, not anotherverb. No behaviour change;
authorized_keysis still never mutated, forthe reason the plan gives.
2 — provision where the seat can actually write, and stop explaining
the failure as if the seat were root.
/optisdrwxr-xr-x root rootandthe degraded seat is uid 37887 with an empty effective set, so the install
is refused by ordinary file permissions and the whole cascade follows. The
destination is now chosen from the seat's own
volumeMounts— the claimon a hotfixed pod,
/optotherwise — with no fallback in eitherdirection, and the report names which was chosen. The
EACCESmessagestops opening by ruling out file modes on the strength of a
CAP_DAC_OVERRIDEthe degraded seat does not hold.3 — merge into a real project's
.vscode, which is JSONC — preservingthe user's committed file rather than round-tripping it. New
podbench.jsonc: parsing is for deciding, and every write is a textualedit of the spans podbench owns, so the user's comments, key order and
formatting survive byte-for-byte. Members go in after the opening brace
because appending has to put a comma after the last value, and where a
//comment trails that line the comma lands inside the comment. No newdependency — typer is still the whole runtime list.
extensions.jsonisincluded: the plan named the two merges it had measured, and the fourth
committed file in that directory has the same defect for the same reason.
5 — why does the adapter never answer
initialize? Answered in twohalves, kept apart. Measured: the redo's own §4 misread the mechanism.
--for-server <n>is the debuggee's transient endpoints listener, boundby
api.listen, handed to the adapter it spawns, and closed about a secondlater — not the adapter's server-facing port. Its absence from the socket
table, and "three socket fds", were reproduced here on sessions that attach
and enumerate threads, so neither is evidence of a wedge; and
initializeis answered by the adapter locally out of a capability table, so it could
never have been diagnostic of a missing debuggee. Driven through podbench's
own
--provisionagainst a virgin pid, with no instrumentation and nohand-fixes, the whole chain works:
pydevd is connected to adapter,initializein 0.00s,attachin 4.00s,threadsreturning the app'sfour. Still not measured, and stated as such: why the redo's client got
zero bytes — it did not reproduce in six attempts, four of them deliberate
wedges, and the seat that saw it is gone (
podbench-homeis anemptyDir). Both candidates the plan named —hostNetwork's127.0.0.1and the
gdb-across-namespacesinterpreter split — are ruled out bymeasurement rather than argument. Evidence:
.claude/evidence/phase8-why-the-adapter-never-answers.md; the supersededsection of the earlier file now carries a pointer at its head.
5b — stop reporting success from an exit code. The success line was
returned whenever the injector exited 0; measured, that exit code was 0,
the port was open, and no session could start.
inject_debugpynow asksthe adapter the first question VS Code asks it and reports four distinct
outcomes, of which only an answered
initializeis success. It closes thesocket without a DAP
disconnect, because the adapter serves one clientand
disconnect_requestcallsstop_serving()— a polite goodbye wouldclose the listener the probe exists to prove.
6 — prove it on the live target, one seat, no hand-fixes. Five of six
checks pass; the sixth is a bridge limitation, not a seat one.
Deliberately not in scope
Mutating
authorized_keys; retiring the p47 target;hotfix init's missing--image/--pullpassthrough (a real defect, but ahotfixone — now filedas #215); Tier 1 GUI-free e2e (#212).
Raised while doing the work
hotfix inithas no--image/--pullpassthrough, so it cannotland a branch build.
a provisioned debugpy shows as untracked in the user's git tree. Nothing is
broken today; filed so it is a decision rather than a discovery.
git statuson the claim fails withdubious ownership, so thefirst thing a user does in the tree
vscodeopens is the thing that breaks.Blocks make hotfix mode feel like a devcontainer: commit and push from the seat, and stop/start the app yourself #202.
nothing, and rewrites
launch.json's live port with a dead one. Newlyvisible rather than newly created: 5b's handshake printed the refusal that
the old exit-code success line hid.
python.defaultInterpreterPathis written, so the window popsup "no Python found" on a pod where podbench knows the answer.
vscodeand commented with the freshevidence.
🤖 Generated with Claude Code
https://claude.ai/code/session_01WAGABUogwWJ68k1Dh28ZBS