Repository navigation
feat(bob-plugin): add the IBM Bob plugin and its status bar - #968
Conversation
6d7ca05 to
ae7fb83
Compare
vz-ibm
left a comment
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 2 (claude, user of @vz-ibm) | Claude Code 2.1.316 | offload-review skill, @vz-ibm's session | fresh | 2 of 2 | 1 of 2 | ae7fb838cb2c |
blocking |
Verdict: blocking
The code is careful. I found no defect in the Go changes, the plugin scripts, reset.sh or the status bar code. The one finding is a missing data-dependence statement for the status bar, which the repo rules require.
Findings
- docs/data-dependence.md:180 — the "Bob plugin" row does not cover the status bar, a new feature of this PR
- What fails: CLAUDE.md says every PR that adds a feature states its data dependence and its behavior at each storage level, in
docs/data-dependence.md. The row names only "routing block, hooks,status". It says "statusreads only the time and agent of the newest Bob request". - The status bar reads more than that:
/api/sessions?agent=bob&limit=1: the newest Bob session id and itssavedtoken count (bob-plugin/statusbar/src/client.ts:86-91)./api/cachestate?session=<id>:end_ts,ttl_s,prefix_tokens,window,priced,money(client.ts:92-94,model.ts:20-30).
doctoralso reads/api/requests?agent=bob(bob_plugin.py:1144,1172-1177). The row does not namedoctoreither.- The row does not say what the status bar shows at the "off" level. From the code: the reads fail,
pollcatches the error, and the bar showsCG ✓ ctx —/270k · cache — · saved 0(client.ts:95-97,model.ts:146-151). So a user sees "saved 0" and no clock, and cannot tell "no data" from "nothing saved". - The PR body says "The status bar reads counts and times from the local API". The doc row does not say it. The rule asks for the doc.
- Fix: add the status bar and
doctorto the row's name and reason. Name the fields each one reads (session id, saved tokens, cache times, prefix size). Say that all of them are metadata, and what the bar shows when the dashboard has no rows. Optional: showsaved —in place ofsaved 0when/api/sessionsfails, so "no data" does not read as "zero".
- What fails: CLAUDE.md says every PR that adds a feature states its data dependence and its behavior at each storage level, in
Non-blocking
bob-plugin/context-guru/README.md:248says "No status bar yet." Lines 55-70 of the same README describe the status bar that this PR ships. Delete line 248.bob-plugin/statusbar_test.go:19-21skips whennpmis absent.bobplugin_test.go:15-18fails whenpython3is absent, with the comment "a skip looks like a pass in CI output". The two choices disagree. In CI,npmis present, so the suite runs. It needs the npm registry on each CI run becausenode_modulesis not cached. This adds a network dependency tomake cover. Consider a cache step, or say so in the test comment.TestBobStatusbarSuitewritesnode_modules/andout/into the source tree duringgo test. Both are gitignored, so this is only a side effect. Worth one line in the comment.MINIMUM_BOB_RELEASE = (0, 3, 1)(bob_plugin.py:47). The X-Task-Id session and Bob cache-write fixes (#967, the first 4 commits here) are not in any release yet. A user who runs setup before the next release gets a binary that routes Bob, but still hashes sessions and counts cache writes as fresh input. The status bar clock then says 5 minutes for a 1-hour cache. Consider raising the minimum to the release that ships #967, when it exists.first_free_port(bob_plugin.py:245-255) binds and closes a port, then launchd binds it later. Another process can take it in between. Setup then fails on/healthzand rolls back, so this fails closed. Only a note.
What I checked
- Read
CLAUDE.md, the session and Bob-route parts ofdocs/design.md, and the PR body. I also read the body of #967 for the behavior change of the first 4 commits. - Read the full diff of all 5 commits:
Makefile,apply/*,dash/capture_test.go,docs/*,proxy/*(proxy.go, bobusage.go, recctx.go, dashcapture.go and all new tests),session/*, and every file underbob-plugin/. I did not read every line ofpackage-lock.json. I checked that all 296resolvedURLs point toregistry.npmjs.org. - Session id (
explicitSessionOf): it readsX-Task-Idonly whenupPath == bobModelPath. Every caller passes the route's static path: chat line 1293, observe shadow line 1989.upstreamForkeepsstatic.path(tenancy.go:716). The host id comes after the header and the metadata fields (session.go:534-545). It goes throughsafeExplicit, so../../xand over-long ids fall back to the derived hash. On the Bob route,applygets an id that is already resolved, andExplicitSession(resolved, body)gives the same id back. The grace alias and the dashAliasFnstill pass"", so the alias stays the content hash, as the comments say. Hosted mode scopes the id per tenant throughsession.Scoped. - Bob usage (
bobUsage): it runs only whenup.path == bobModelPath, on the stream path (streamRecOn, both calls) and on the buffered path (proxy.go:2305-2308). It is fail open: the code returnsbaseunchanged for a non-object block, a missing or non-integer count,write1h > write, orread + write > prompt.providerusage.Parseis unchanged. No other caller ofresponseUsageWhyexists outside tests. - Plugin scripts: rc-block ownership, the one-hop symlink rule, atomic writes that keep the file mode, and the exact-restore rule of
bob_hooks. I also checked the parity ofreset.shwith them (perl regex =block(), the"exact"/"existed"checks), setup'sUndoorder,change_and_restartrestore and Ctrl-C handling, and the state lock. Hooks always exit 0 (|| true,</dev/null, thecheckoutput only).signalsends only 3 fields, only forSessionStart. The proxy's/signalaccepts thesession_id/hook_event_name/sourcenames (clientsignal.go:139-157). - Security:
valid_upstreamallows onlyhttps://*.bob.ibm.com. The proxy listens on127.0.0.1only. The release download is checked againstchecksums.txt. Tar extraction takes one regular-file member by base name, so no path traversal is possible. Presets are an allow-list. The status bar refuses any host but127.0.0.1, has a total deadline and a 1 MiB cap, and does not follow redirects. - Presets:
lossless=format, toon, cachesplit. All three are Reformat components.cachesplitis a no-op on OpenAI chat. A config withpipeline:and nopreset:loads (config.go:438-441). - Keep-alive: strategies and the predictive campaign skip
provider == OpenAI(keepalive.go:377, 461, 487). Sononeis the only strategy that means something for Bob, as the plugin says. - Status bar API shapes: they match the server.
/api/sessionsrows havesession_idandsaved(dash/query.go:538, 559)./api/cachestatehasend_ts,now_ms,ttl_s,prefix_tokens,window(dash/cachestate.go:19-61)./api/requestsgivesrequests[].ts.agent=bobgoes throughfilterFrom. - I did not run the tests. Live tests are not approved, and Go is not installed here.
vz-ibm
left a comment
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 1 (claude, user of @vz-ibm) | Claude Code 2.1.316 | offload-review skill, @vz-ibm's session | fresh | 1 of 2 | 1 of 2 | ae7fb838cb2c |
blocking |
Verdict: blocking
Findings
- bob-plugin/statusbar/src/client.ts:41-66 —
getJsonnever settles when the proxy closes the connection in the middle of a reply. Then the status bar stops polling and keeps showingCG ✓.- What fails: the proxy sends the status line and headers, then closes the socket before the body ends. A proxy restart can do this:
configure,update, a launchd restart after a crash, oruninstall. Node then emitsabortedandcloseon the response. It emits noend, and the request emits noerror. So no listener callsresolveorreject. Thedeadlinetimer fires, butrequest.destroy(...)on a socket that is already closed emits nothing. The promise stays pending forever. - Effect:
tick()inextension.ts:30-40waits onpoll()forever, so it never schedules the nextsetTimeout. The status bar stops polling until Bob restarts.clockTimerkeeps redrawing the last snapshot. So the user seesCG ✓ … cache 1h 54:10count down while the proxy is down and Bob cannot reach its backend. The status bar exists to show exactly that state (CG ✗). - Proof: I wrote a copy of the same promise logic, against a raw server that sends
HTTP/1.1 200 OK\r\nContent-Length: 100\r\n\r\n{"a":and then destroys the socket. The deadline was 500 ms (node v24.2.0):The current tests do not cover this case. "a server that drips bytes" keeps the socket open, so itsRES ABORTED RES CLOSE complete= false HUNG: promise never settled (after 2000 ms)destroystill emitserror. - Fix: make the deadline itself call
fail(new Error('timeout')). Also addresponse.on('aborted' | 'error' | 'close')handlers that reject whenresponse.completeis false, and use a settle-once guard. Add a test: the server writes the headers and part of the body, then destroys the socket, andgetJsonmust reject within the deadline.
- What fails: the proxy sends the status line and headers, then closes the socket before the body ends. A proxy restart can do this:
Non-blocking
- The
signalhook does nothing for Bob today. The README says that after a compaction, the proxy drops the old cache entries (README.md, "Two hooks"). But the keeper never tracks Bob's route:proxy/keepalive.go:377and:428excludebschemas.OpenAI, and Bob's model route is OpenAI chat. Also, nothing shows that Bob's hooksession_idis the same as theX-Task-Idsession key. Fix the README claim, or drop the handler until keep-alive covers Bob. - The README contradicts itself. "Known gaps" still says "No status bar yet.", and the "Status bar" section above it describes the status bar.
MINIMUM_BOB_RELEASE = (0, 3, 1)andfind_binarydo not gate on what the plugin uses.binary_problemaccepts any binary with--bob-upstream, and v0.2.0 already has that flag. The status bar reads/api/cachestate, which first ships in v0.6.0. TheX-Task-Idsession (#967) is not in any release yet (v0.6.7 has noX-Task-Id). An older brew binary on PATH passesdoctor binary=ok, and the status bar then shows—for every field. Consider a version floor for a PATH binary, or adoctorwarning.- CI now runs npm install scripts.
TestBobStatusbarSuiterunsnpm ciwith no--ignore-scripts. So every CI run executes the install scripts of@vscode/vsce-signandkeytar(bothhasInstallScriptin the lock file). The tests need onlytypescriptand the@typespackages. Add--ignore-scriptsto the test'snpm cito make the supply-chain surface smaller. Themake bob-statusbarpackaging may still need the scripts. The npm registry is also a new network dependency forgo testin CI, and withCIset, an npm outage fails the build. - The PR body says 167 Python tests. I count 161
def test_(116 + 45). Subtests or a skip count may explain the difference. Please check the number.
What I checked
CLAUDE.md, thedocs/design.mdsession section, and the PR body. I also read the #967 body, because its commits are in this diff.- The full Go diff:
session.Explicithost ids (last in order, sanitized byExplicitID),apply.ExplicitSession, andexplicitSessionOf. I checked every caller of the session id on the chat path: the pipeline opts, the expand repair, the observeRecordBilledInput, andnewRecCtx. Every other route still reads only the session header./compactandGET /expandstay unchanged on purpose. bobUsageandbobResponseUsage: the fail-open returns (missing, negative, fractional, or 1h > write, read + write > prompt), and both stream paths plus the JSON path inserve. I found no otherresponseUsageWhycall site that skips the correction.- The tests:
session_test,bobsession_test,bobusage_test,bobprofile_test,sessionrec_test,dash_test,capture_test(by name and shape). bob_plugin.pyin full: setup consent, the refusals before the lock, theUndoorder and re-run safety,change_and_restartrollback, update staging and checksum (the tar member is read withextractfile, so there is no path traversal), doctor bundle checks, the status and hook handlers (they exit 0 and do not read the prompt), and uninstall.bob_route.py: block ownership states, the symlink rule, byte-exact remove, and the probe env.bob_hooks.py: tag matching, the duplicate-key refusal, and the exact-restore conditions on install, re-install, and remove.reset.sh: the perl block regex is the same asbob_route.block. The hooks exact restore follows the same rule asbob_hooks.remove. The osascript fallback, and the launchd ownership check.- The status bar:
model.ts,client.ts,extension.ts,package.json,.vscodeignore, the lock file registry (all from registry.npmjs.org), and the Go wrappersbobplugin_test.goandstatusbar_test.go. - The 7 skills, the README, the data-dependence rows (the new "Bob plugin" row and the session and usage additions),
docs/design.md, and the Makefile target. - The plugin scripts parse as Python 3.9 (
/usr/bin/python3on macOS). The CI checks on the PR are green. - I did not run Go, Python or npm tests (live tests are not approved). The only thing I ran is the standalone Node repro for finding 1.
Round 1: repliesBoth findings are fixed in R1-1:
R2-1: the data-dependence row does not cover the status bar. Fixed.
Non-blocking, fixed:
Non-blocking, no change:
Checks
|
vz-ibm
left a comment
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 1 (claude, user of @vz-ibm) | Claude Code 2.1.316 | offload-review skill, @vz-ibm's session | resumed | 1 of 2 | 2 of 2 | 2bf2b2677bbb |
approve |
Verdict: approve
Findings
None.
Earlier findings
- Reviewer 1, finding 1 (
getJsonnever settles on a cut-off reply): fixed.failnow settles once, clears the deadline and destroys the request. The deadline callsfailitself. Newaborted,errorandclose(!response.complete) handlers reject.endcheckssettled.- I ran the new logic as a standalone copy (node v24.2.0), with a 300 ms deadline:
cut rejected reply cut off 27ms ok resolved {"a":1} 2ms chunkedok resolved {"a":2} 1ms s500 rejected status 500 1ms headersonly rejected timeout 306ms closebeforehdr rejected socket hang up 3ms - The "too large" path now goes through
fail, so it also settles once. - The new test
a reply cut off mid-body fails within the total deadlinehas the same shape as my repro. It has a 3,000 ms test timeout, so a hang fails the test and does not block the suite.
- Reviewer 2, finding 1 (the data-dependence row does not cover the status bar): fixed. The row now names
status,doctorand the status bar. It names each field they read (all counts, times and ids), and what the bar shows with the dashboard off. I checked this againstclient.ts: a failed/api/sessionsread leavessnap.savedundefined, so the bar showssaved —. A realsaved: 0still showssaved 0(client.test.ts:93,:237).
Earlier non-blocking notes
signalhook claim: fixed. The README now says that the hook changes nothing on Bob today. This agrees withproxy/keepalive.go:428.- "No status bar yet.": removed.
npm ciinstall scripts: fixed in both places (the Makefile andstatusbar_test.go). The author reports that build, tests and.vsixpackaging work without the scripts. I did not run them.- Test count: I accept the reply. 161
def test_plus subtests gives 167. MINIMUM_BOB_RELEASE: deferred until the release with #967 exists. I accept this. That release does not exist yet, so a floor cannot name it.
Non-blocking
Makefile:58: the new# --ignore-scripts …line sits inside the recipe, with a tab before it. So make prints it and passes it to the shell, where it does nothing. Above the target, as a make comment, it would not print. It is cosmetic only.
What I checked
- Last review: round 1,
ae7fb838cb2c7d8c9e0b16d76a08a9e43b1821cf, 2026-11-09T08:56:34Z - New commits read: 1 (
2bf2b267fix(bob-plugin): status bar never hangs on a cut-off reply; review fixes) - Read in full: 2 reviews, 1 comment, 0 inline comments (from the three files)
- New items since my last review:
- Commit
2bf2b267: I read the full diff and the wholegetJsoninclient.ts. I ran the new logic against 6 server behaviors (see above). - Comment by vz-ibm at 2026-11-09T09:18:12Z (the round 1 replies): I checked each reply against the code. Each one is accepted above.
- Commit
- Older items, read again: reviewer 2's round-1 review (08:32:00Z). I checked its finding against the new data-dependence row and
client.ts. Its non-blocking notes on the npm skip andfirst_free_portgot replies, and I accept both. formatSavedandpoll: undefined now means "no data", and 0 still means zero. I checked every changed test expectation. Each one asserts a specific string.docs/data-dependence.mdBob plugin row: it says metadata at every level, and it matches what the code reads.- I did not run Go, Python or npm tests (live tests are not approved). The only thing I ran is the standalone Node copy of
getJson.
vz-ibm
left a comment
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 2 (claude, user of @vz-ibm) | Claude Code 2.1.316 | offload-review skill, @vz-ibm's session | resumed | 2 of 2 | 2 of 2 | 2bf2b2677bbb |
approve |
Verdict: approve
Both round-1 findings are fixed. The new commit adds no defect.
Findings
None.
Status of earlier findings
- Reviewer 1, finding 1 (
getJsonnever settles on a reply cut off mid-body): fixed. I traced the new code inbob-plugin/statusbar/src/client.ts:38-82:failis guarded bysettled, clears the deadline, destroys the request and rejects. The deadline timer now callsfailitself. So the promise settles at the deadline at the latest, even whendestroy()emits nothing.- A cut-off reply now rejects on
aborted, or onclosewithresponse.complete === false.endsetssettled, so theclosethat follows a good reply does nothing. failreadsdeadlineandrequestbefore theirconstlines. This is safe: only timers and events callfail, and those run after both names are set.- The new test
a reply cut off mid-body fails within the total deadlinereproduces the reviewer's case: headers plus{"a":, then the socket is destroyed. It has a 3 s test timeout, so the old code fails it. - So
tick()inextension.tsalways reaches its nextsetTimeout, and a down proxy showsCG ✗.
- Reviewer 2 (me), finding 1 (data-dependence row did not cover the status bar): fixed.
docs/data-dependence.md:233now namesstatus,doctorand the status bar. It lists the fields each one reads and says what the bar shows at the "off" level. I checked the claims against the code:statusanddoctorread onlyrequests[0].ts(bob_plugin.py:1172-1177).- The status bar reads
session_idandsavedfrom/api/sessions, then/api/cachestate(client.ts:95-103). - With no rows, or a failed read,
snap.savedstaysundefined.formatSavedthen givessaved —(model.ts:95-98), andcachestays unset, so the clock shows—. A real 0 still showssaved 0.
- Non-blocking notes from round 1:
- README "No status bar yet": removed.
- The
signalhook claim (reviewer 1): the README now says thatsignalchanges nothing else on Bob today. This matchesproxy/keepalive.go:377, 428. npm ciinstall scripts (reviewer 1):--ignore-scriptswas added to the Makefile and toTestBobStatusbarSuite. The tests need onlytypescriptand@types/*, which have no install scripts.MINIMUM_BOB_RELEASE(both reviewers): the author defers the change until the release with #967 is tagged. I accept this: no such tag exists yet.- Test count, the
npmskip against thepython3fail, and thefirst_free_portrace: the author kept them, with reasons. I accept the reasons. The skip applies only whennpmis absent, and CI has Node. The port race fails closed.
Non-blocking
docs/data-dependence.md:233says the status bar reads "counts, times and ids". It also readspricedandmoney.*.saved_usdfrom/api/cachestate(model.ts:99-102). These are numbers too, so the level stays metadata. Consider naming them, for a full list.- Track the
MINIMUM_BOB_RELEASEraise in an issue, so it is not lost when #967 ships.
What I checked
- Last review: round 1, ae7fb83, 2026-11-09T08:32:00Z
- New commits read: 1 (
2bf2b267fix(bob-plugin): status bar never hangs on a cut-off reply; review fixes) - Read in full: 2 reviews, 1 comment, 0 inline comments (from the three files)
- New items since my last review:
- Reviewer 1's round-1 review (08:56:34Z): I read it in full. I checked its finding 1 against the new code (fixed, see above), and its 5 non-blocking notes against the author's replies.
- The author's comment "Round 1: replies" (09:18:12Z): I checked each reply against the diff and the code. All the claimed changes are in
2bf2b267. - Commit
2bf2b267: I read all 8 files of the diff in full:Makefile,README.md,client.ts,model.ts, both test files,statusbar_test.goanddocs/data-dependence.md. I also read the code around each change:getJson,poll,formatSaved,render, and the README "Two hooks" section.
- I read the 4 changed test expectations and the 1 changed test input (
saved: 0in "an expired cache renders cold"). Each asserts the new output, and none is weaker than before. - I did not run the tests. Live tests are not approved, and Go is not installed here.
New fixes after round 2The review of #973 found 3 real bugs in code this PR adds. They are fixed in
Each fix has tests that fail on the old code. Details: #973 (comment). |
vz-ibm
left a comment
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 2 (claude, user of @vz-ibm) | Claude Code 2.1.316 | offload-review skill, @vz-ibm's session | resumed | 2 of 2 | 3 of 3 | b234116ed8d0 |
approve |
Verdict: approve
The 3 fixes in b234116e are correct. Each one has a test that fails on the old code. I found no new defect.
Findings
None.
Status of earlier findings
- Reviewer 1, round 1, finding 1 (
getJsoncut-off reply): fixed in2bf2b267. The new commit does not touch it. - Reviewer 2 (me), round 1, finding 1 (data-dependence row): fixed in
2bf2b267. The new commit does not change what the plugin reads, so the row is still correct. - Reviewer 1, round 2, non-blocking (Makefile comment line inside the recipe): not changed. It is cosmetic only.
MINIMUM_BOB_RELEASE: still deferred, with a reason. I accept the reason.
New commit b234116e
- Local calls skip
HTTP_PROXY: correct.LOOPBACK = build_opener(ProxyHandler({}))(bob_plugin.py:232). An emptyProxyHandlermapping turns off the proxies from the environment for that opener.- All 3 loopback calls use it:
healthy(:236),last_bob_request_ms(:1181),signal_hook(:1280). I found no otherurlopento127.0.0.1. The 2 calls that stay onurllib.request.urlopengo to GitHub (:325,:333), as the comment says. - The new test class sets
HTTP_PROXY, removesNO_PROXY, and checks that the fake corporate proxy got no path and no signal. It coversstatusandsignal.statusrunshealthyandlast_bob_request_ms.
- The rc block is safe under nounset: correct.
block()now writes${VAR:-}(bob_route.py:44-60).our_blocks()returns the new form and the legacy form, andownershipaccepts both (:87)._presentpicks the form the file holds.ownershipaccepts exactly one block, so the pick has one match._writable_state,installandremoveall use it. So a legacy block is removed byte for byte, and a re-run of setup replaces it with the new form (installreturns "already" only when the new form is present,:238).reset.sh:103: the perl regex accepts both forms. The groups it adds are(?:…), so$1and$2are still the 2 ports.- Tests: the legacy round trip, install over a legacy block, reset of a legacy block, and a real
zshrun withsetopt nounset. Thezshrun checks that the user's line after the block still runs.
reset.shkeeps a config the user wrote: correct.- It deletes
bob-PORT.yamlonly when line 1 is the marker (reset.sh:245). This is the same rule asuninstall(bob_plugin.py:1342). The$(head …)inside[ ]does not stop the script underset -ewhen the file is absent. - A test pins the marker text in
reset.shtoCONFIG_MARKER, so the two cannot drift.
- It deletes
Non-blocking
- The perl regex is wider than Python. It accepts each variable in either form, one at a time. So it also removes a mixed block (one bare
$VAR, one${VAR:-}). Python calls that blockcannot_telland leaves it. Setup never wrote a mixed block, and the emergency reset should remove more, not less. Only a note. - The probe is not nounset-safe (old code).
_PROBE(bob_route.py:292) reads"$VITE_GATEWAY_BASE_URL"bare. Undersetopt nounset, the terminal probe fails, because that variable is unset there. Thenterminal_ideis"", sorc_probe=okstill holds, butterminal_shellis empty. Use${VAR:-}in the probe too, for the same reason as the block. - The README nounset note. The README now shows the new block. It could also say that an old block still works, and that setup upgrades it.
What I checked
- Last review: round 2, 2bf2b26, 2026-11-09T09:30:16Z
- New commits read: 1 (
b234116efix(bob-plugin): local calls skip HTTP_PROXY; rc block is nounset-safe) - Read in full: 4 reviews, 2 comments, 0 inline comments (from the three files)
- New items since my last review:
- Reviewer 1's round-2 review (09:30:12Z, approve). I read it in full. Its one non-blocking note (the Makefile comment) is still open and is cosmetic.
- The author's comment "New fixes after round 2" (11:03:06Z). It names 3 bugs found in the review of #973. I checked each fix against the diff and the code (see "New commit" above). I did not open the linked #973 comment. The commit message, this comment and the tests give the full change.
- Commit
b234116e: I read the full diff of all 5 files (README.md,bob_plugin.py,bob_route.py,reset.sh,test_bob_plugin.py). I also read the code around each change: allurlopen/LOOPBACKcall sites,ownership,install,remove,_writable_state,probe, and the reset perl block.
- I checked that nothing else in the repo holds the old block text. Only
bob_route.py,reset.sh, the README and the tests contain it. - I did not run the tests. Live tests are not approved, and Go is not installed here.
vz-ibm
left a comment
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 1 (claude, user of @vz-ibm) | Claude Code 2.1.316 | offload-review skill, @vz-ibm's session | resumed | 1 of 2 | 3 of 3 | b234116ed8d0 |
approve |
Verdict: approve
Findings
None.
The 3 fixes in b234116e
- Local calls skip
HTTP_PROXY: fixed.healthy,last_bob_request_msandsignal_hooknow useLOOPBACK, an opener withProxyHandler({}).- Only
latest_release_tagandfetchstill useurllib.request.urlopen. Both go to GitHub, so they keep the user's proxy, as intended. - Proof (
/usr/bin/python33.9,HTTP_PROXYset, noNO_PROXY):urlopento 127.0.0.1 reached the fake corporate proxy.LOOPBACK.openreached the local server directly:[('corp', 'http://127.0.0.1:52519/a'), ('local', '/b')]
- The rc block works under
setopt nounset: fixed. I ran real zsh withsetopt nounsetin.zshrc, then the block, then a user line:new block, terminal: USER-LINE-RAN | url=http://127.0.0.1:8891 new block, Bob env: USER-LINE-RAN | ide=http://127.0.0.1:8891 legacy, terminal: .zshrc:5: VSCODE_RESOLVING_ENVIRONMENT: parameter not set | url=unset- The legacy block stopped the file in a terminal, and the new block does not. The Bob-env guard still sets the IDE address.
ownershipaccepts both exact forms throughour_blocks._presentpicks the form that is in the file.installreplaces a legacy block on the same port, and does not returnalready.removetakes out either form byte for byte.reset.shperl regex: I ran the program fromreset.shon 3 files: the new block, the legacy block, and a block with one character edited. The results were exit 0, exit 0 and exit 4. Both good forms leavealias g=gittail, the exact user bytes. The edited block is refused.
reset.shkeeps a config the user wrote: fixed. It now deletesbob-PORT.yamlonly when line 1 is the marker. A missing file is safe underset -eu: the command substitution is inside aniftest. A test pins the marker string toPLUGIN.CONFIG_MARKER, so the two cannot drift apart.
Earlier findings
- Reviewer 1, round 1, finding 1 (
getJsonhang): still fixed.b234116edoes not change the status bar. - Reviewer 2, round 1, finding 1 (data-dependence row): still fixed.
b234116edoes not change the docs.
Non-blocking
doctorreportsrc_block=okfor a legacy block. That block still breaks.zshrcfor a user withsetopt nounset. Only Macs that ran setup from this branch have the legacy form, so the risk is small. Awarnwith "run setup again" would move those users to the new form.- Reviewer 2's round-2 notes (name
pricedandmoneyin the data-dependence row, and track theMINIMUM_BOB_RELEASEraise in an issue) have no reply yet. Both are non-blocking.
What I checked
- Last review: round 2,
2bf2b2677bbbb6d6d3510e379b80eabafb2378d0, 2026-11-09T09:30:12Z - New commits read: 1 (
b234116efix(bob-plugin): local calls skip HTTP_PROXY; rc block is nounset-safe) - Read in full: 4 reviews, 2 comments, 0 inline comments (from the three files)
- New items since my last review:
- Reviewer 2's round-2 review (09:30:16Z): I read it in full. It approves and has 2 non-blocking notes. Neither note is answered yet (see above).
- Comment by vz-ibm at 2026-11-09T11:03:06Z ("New fixes after round 2"). It names 3 bugs that the review of #973 found. I checked each fix in the code, and ran each one where I could (see above). I did not open the linked #973 comment, because the 3 bugs are stated in full here.
- Commit
b234116e: I read all 5 files of the diff, and the code around each change inbob_route.py(ownership,_writable_state,install,remove,is_routed) andbob_plugin.py. I also read the new tests:LoopbackNeverUsesTheUserProxyTest, the nounset zsh test, the legacy-block tests, and the 4reset.shtests. Each one asserts specific bytes or paths.
- I did not run the Go, Python or npm test suites (live tests are not approved). I ran standalone checks only: the Python opener, zsh on both block forms, and the
reset.shperl program on 3 files.
The plugin routes the Bob IDE and Bob Shell through a local context-guru proxy, and gives Bob 7 skills to control it: setup, status, doctor, update, uninstall, preset picker and cache strategy picker. - setup adds one guarded block to the shell startup file and two hooks to Bob's settings, after the user's explicit consent. It shows the plan first and rolls back on any failure. - uninstall gives back both files byte for byte. - The proxy runs as a launchd service on 127.0.0.1, ports 8891-8990. - The status bar extension shows CG health, context fill and the cache clock. It calls only the local proxy. Bob plugins cannot carry hooks, so setup writes them. The plugin is macOS only. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Vitaly Zabershinsky <[email protected]>
- getJson settles once, and its deadline rejects by itself. A reply cut off mid-body (a proxy restart) emits no end and no error, so the status bar stopped polling and kept showing CG ✓ while the proxy was down. A new test fails without the fix. - With no data, the status bar shows "saved —", not "saved 0". - npm ci runs with --ignore-scripts. The build, tests and .vsix do not need a dependency's install script. - docs/data-dependence.md: the Bob plugin row names the status bar and doctor, and the fields they read. - README: the signal hook changes nothing on Bob today, and the stale "No status bar yet" line is gone. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Vitaly Zabershinsky <[email protected]>
- Calls to the local proxy (healthz, the newest Bob request, the signal
hook) went through the user's HTTP_PROXY. On a corporate Mac with no
NO_PROXY for 127.0.0.1 they failed, and the signal hook sent the Bob
session id to the corporate proxy. They now use an opener with no
proxy. Downloads from GitHub keep the user's proxy.
- The rc block read $VSCODE_RESOLVING_ENVIRONMENT and
$__CFBundleIdentifier bare. Under setopt nounset (or set -u) zsh
stopped reading .zshrc at the block, so every user line after it was
skipped. The block now uses ${VAR:-}. The legacy form is still ours:
setup upgrades it, and uninstall and reset remove it byte for byte.
- reset.sh deleted bob-PORT.yaml even when the user wrote it. It now
deletes it only when the first line is our marker, as uninstall does.
Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Vitaly Zabershinsky <[email protected]>
Setup under bash wrote the block to ~/.bash_profile. Setup again under zsh wrote a new block to ~/.zshrc and kept only the new file in the record, so uninstall removed one block, said result=removed, and left ~/.bash_profile routing Bob to a proxy that was gone. rc_created was also kept from the old file and applied to the new one. Setup now removes our exact block from the old file once the new block is in place, so Bob stays routed throughout. An edited old block is left alone and reported. rc_created is kept only for the same file. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Vitaly Zabershinsky <[email protected]>
Three tests ran setup under SHELL=/bin/zsh and expected exit 0. Setup then ran the real zsh rc probe. The test home is not a macOS home, so the probe saw nothing. Setup reported installed_not_verified and exited 1. This failed on the Linux CI runner, which has /bin/zsh. The tests are about the old rc block, not the probe. They now stub bob_route.probe, as test_a_probe_miss_is_reported_plainly does. The product code is unchanged. Assisted-By: Claude Opus 5.5 <[email protected]> Signed-off-by: DAVID AMID <[email protected]>
a4b1ae0 to
6fa1627
Compare
SummaryPR #968 is rebased on main. CI is green. What changed
Why the tests failed
How it was tested
|
amiddavid
left a comment
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 1 (claude, user of @amiddavid) | Claude Code 2.1.319 | offload-review skill, @amiddavid's session | fresh | 1 of 2 | 4 of 4 | 6fa1627e64ed |
blocking |
Verdict: blocking
The new commit 62d2a91e fixes the shell-change leak on the success path. But a setup that fails after the shell change now removes the route from both files and still reports rolled_back=true.
Findings
- bob-plugin/context-guru/scripts/bob_plugin.py:653-654 — a failed re-run after a change of shell leaves Bob routed nowhere, and says
rolled_back=true- What fails: setup ran under bash, so
~/.bash_profilehas our block. The user switches to zsh and runs setup again._remove_old_rc_blockdeletes the old block (and the file, if setup created it) right after the new block goes in. A later step then fails (bob_hooks.install,install_escape_hatch, or the finalwrite_record).Undo.runremoves the new.zshrcblock, becausehad["rc"]is about the new file only. Nothing puts the old block back. Result: no file routes Bob. The old service is back and healthy, and the record (write_record(self.old_record)) still names.bash_profile.doctorthen reports a missing block. - This breaks the rule in the code itself: "What was already in place before this run. A failed re-run must not undo it." (
bob_plugin.py:624). - Proof: a scratch test on
TempHome(in/tmp, not in the worktree). Setup under bash, then setup underSHELL=/bin/zshwithbob_hooks.installpatched to raiseOSError("disk full"):before: bash_profile routed = True exit 1 old_rc_file=.../home/.bash_profile old_rc_block=removed result=setup_failed detail=disk full rolled_back=true after: bash_profile exists = False routed = False after: zshrc routed = False record rc_file = .../home/.bash_profile - Fix (pick one):
- Move the old-block removal to the end of the
try, after the finalwrite_record(record). Then any failure leaves the old block in place, and Bob stays routed through the old file. - Or add an undo step that restores the old file's bytes (snapshot it first, as
old_configdoes).
- Move the old-block removal to the end of the
- Add a test for this case: shell change plus a failure after the rc step must leave the old block routed.
- What fails: setup ran under bash, so
Non-blocking
- The docstring of
_remove_old_rc_block(:594) says "uninstall still names the old file in old_rc". Noold_rckey goes into the record (:630-632). Uninstall andreset.shread onlyrc_file, which is now the new file. So on theOSErrorbranch, the old block stays after uninstall, and uninstall saysresult=removed. This is the same leak that the commit fixes, on a rare path. Storeold_rc_filein the record when the removal fails, and have uninstall andreset.shremove it too. Or fix the docstring. For an edited block, leaving it is right. 6fa1627eis test-only. Thegood_probestub matches whattest_a_probe_miss_is_reported_plainlydoes. The 3 tests still check the old block, the user's.zshrcbytes, andold_rc_block=output. None is weaker.
Status of earlier findings
- Reviewer 1, round 1, finding 1 (
getJsonhang): still fixed.client.tsis unchanged since round 3. - Reviewer 2, round 1, finding 1 (data-dependence row): still fixed. The new commits do not change what the plugin reads. The row stays correct.
- Earlier non-blocking notes (Makefile comment line,
MINIMUM_BOB_RELEASE,priced/moneyin the row, the legacy block indoctor, the probe under nounset): no change. They stay non-blocking.
What I checked
- Last review: round 3,
b234116ed8d0d73068aa8d7a07b24100b276c4c7, 2026-11-09T13:55:40Z - New commits read: 2 (
62d2a91efix(bob-plugin): a shell change between setups leaves no old rc block;6fa1627etest(bob-plugin): stub the rc probe in the shell-change tests) - The branch was rebased on main, so
b234116eis not an ancestor of HEAD.git range-diff 587a8658..b234116e 682f6a9e..HEADshows the 3 plugin commits unchanged (=). The 4 #967 commits dropped out; #967 is on main as682f6a9e. So the new work isgit diff 9e2de5d0..HEAD, and I read all of it. - Read in full: 6 reviews, 3 comments, 0 inline comments (from the three files)
- New items since my last review:
- Reviewer 2's round-3 review (13:55:22Z): read in full. It approves at the old head. Its 3 notes are non-blocking.
- Comment by amiddavid at 15:46:02Z (rebase and test fix). I checked its claims: the rebase dropped only the #967 commits, and
6fa1627echanges only the test file. This does not mention62d2a91e, a product-code change. "Product code: unchanged" is true only for6fa1627e. - Commit
62d2a91e: I read the diff, all of_setup_changes,Undo,uninstall,_find_our_rc_file, andbob_route.install/remove/backup_once. I tracedrc_createdfor both files: the new file keeps the old value only when it is the same file. That is correct. The failure path gives finding 1. - Commit
6fa1627e: see Non-blocking.
- I ran one scratch Python test (
/usr/bin/python3, importstest_bob_plugin, temp home). I did not run Go, the full Python suite or npm (live tests are not approved).
amiddavid
left a comment
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 2 (claude, user of @amiddavid) | Claude Code 2.1.319 | offload-review skill, @amiddavid's session | fresh | 2 of 2 | 4 of 4 | 6fa1627e64ed |
blocking |
Verdict: blocking
The new shell-change fix (62d2a91e) is correct on the success path. It removes the old block before the run can fail, so a failed re-run no longer puts the old route back. The test-stub commit (6fa1627e) is correct.
Findings
- bob-plugin/context-guru/scripts/bob_plugin.py:653-654 — a failed re-run after a change of shell leaves Bob with no route, and reports
rolled_back=true- What fails: the first setup ran under bash and wrote
~/.bash_profile. Setup then runs again under zsh. It installs the block in~/.zshrc, then_remove_old_rc_blockremoves the block from~/.bash_profile. If setup created that file, it also deletes the file. After that, a later step in the sametryfails:bob_hooks.install(:656),install_escape_hatch(:657), the lastwrite_record(:664), or Ctrl-C, which the code handles on purpose (:665). - Trace of
Undo.runfor this case:hooks:had["hooks"]is True (the first setup installed them), so nothing changes.rc:had["rc"]checks only the NEW file (:626), so it is False.bob_route.remove(~/.zshrc)removes the new block.service: the old plist goes back.olderis True, sowrite_record(old_record)puts backrc_file=~/.bash_profile.- Nothing puts back the old block. The removal is not an undo step.
- Result: neither file has a block, so Bob is not routed. The output says
rolled_back=true. The record names~/.bash_profile, and that file holds no block.doctorthen reports a missing block. Before this commit, the same failure left the old block in place, so Bob stayed routed. - This breaks the rule in the code itself: "What was already in place before this run. A failed re-run must not undo it." (
:624). - Fix: move the
_remove_old_rc_block(...)call out of therc_file is not Nonebranch. Put it after the lastwrite_record(record)(:664), still inside thetry, or right after thetry. The new block is still in place first, so "Bob is routed throughout" stays true. Add a test: bash setup, then a zsh re-run wherebob_hooks.installraises. Then check that~/.bash_profilestill holds the block.
- What fails: the first setup ran under bash and wrote
Non-blocking
- The docstring at
:594names a safety net that does not exist. It says "uninstall still names the old file in old_rc". No code writesold_rcto the record (grep old_rcfinds onlysetup). The record'src_filenow names the new file. So whenbob_route.removefails withOSErroron an exact block, uninstall andreset.shnever touch the old file again, and the old bug comes back for that case. Fix the docstring, or storeold_rc_filein the record when the removal fails, and haveuninstallandreset.shread it. - The
rc_createdchange has no test that fails on the old code. Test 1 putsalias ll=…in~/.zshrc.bob_route.removedeletes a file only when it is empty after the removal. So the file stays, whateverrc_createdis. The case that matters is an empty~/.zshrcthat the user owns: the old code deletes it at uninstall. Usezshrc.write_bytes(b"")in a test, and check that the file still exists after uninstall. - A move to a shell with no rc file (fish, for example) still leaves the old block.
rc_fileisNone, soold_rc and not same_rcis never reached. The record then storesrc_file=None.uninstallandreset.shlook only in the candidates for the current$SHELL, which is an empty list for fish. So uninstall saysresult=removedand leaves~/.bash_profilewith a block. fish does not read that file, so the risk is small. It routes Bob to a stopped proxy only if the user goes back to bash. - The author's comment at 15:46 says "Product code: unchanged" and "One new commit". Since round 3 there are two new commits.
62d2a91echanges whatsetupdoes. The comment is true only for6fa1627e. This is not a behavior change for released users, because the plugin is new in this PR.
Status of earlier findings
- Reviewer 1, round 1, finding 1 (
getJsonhang): fixed in2bf2b267. The rebase did not change it (git range-diffshows=). - Reviewer 2, round 1, finding 1 (data-dependence row): fixed in
2bf2b267. The new commits do not change what the plugin reads, so the row is still correct. - Earlier non-blocking notes (Makefile comment line,
MINIMUM_BOB_RELEASE,priced/moneyin the row, the probe under nounset, adoctorwarn for a legacy block): no change and no reply. All are non-blocking. I keep none of them as findings.
What I checked
- Last review: round 3,
b234116ed8d0d73068aa8d7a07b24100b276c4c7, 2026-11-09T13:55:22Z - New commits read: 2 (
62d2a91efix(bob-plugin): a shell change between setups leaves no old rc block;6fa1627etest(bob-plugin): stub the rc probe in the shell-change tests)- The branch was rebased, so
b234116eis not an ancestor of HEAD.git range-diffshows that the 3 old plugin commits are identical (=) and the 4 #967 commits were dropped (they are on main as682f6a9e). So I diffed9e2de5d0..HEAD(the rebasedb234116e). It touches onlybob_plugin.pyandtest_bob_plugin.py.
- The branch was rebased, so
- Read in full: 6 reviews, 3 comments, 0 inline comments (from the three files)
- New items since my last review:
- Reviewer 1's round-3 review (13:55:40Z, approve): read in full. Its non-blocking notes are still open, and none is a defect.
- Comment by amiddavid (15:46:02Z, the rebase report): I checked the rebase with
git range-diffand the test fix in6fa1627e. Its "product code unchanged" claim is wrong for62d2a91e(see Non-blocking). - Commit
62d2a91e: read the diff, all ofsetupand_setup_changes,Undo,uninstall,_find_our_rc_file, andbob_route.remove,candidates,rc_candidates,_block. Traced success, edited old block,OSError, a failed later step, and a move to fish. Finding 1 and the notes come from these traces. - Commit
6fa1627e: the stub returnside=http://127.0.0.1:<port>andterminal_ide="", which is whatokneeds (:684). The first setup in each test runs under theTempHomedefaultSHELL=/bin/bash, as other passing tests do. The uninstall in test 1 runs inside the stub too.
- I did not run the tests. Live tests are not approved, and Go is not installed here.
After a change of shell, setup removed the old rc block right after it wrote the new one. A later step could then fail (hooks, escape hatch, the last record write, Ctrl-C). The rollback removed the new block and nothing put the old one back. No file routed Bob, and the output said rolled_back=true. Setup now removes the old block as its last step, after the final record write. A failed run leaves the old block in place. New test: a bash setup, then a zsh re-run where bob_hooks.install raises. The old .bash_profile block must stay. Assisted-By: Claude Opus 5.5 <[email protected]> Signed-off-by: DAVID AMID <[email protected]>
Round 4: fixed in 04b7f2fBoth reviewers found the same defect. After a change of shell, setup removed the old rc block right after it wrote the new one. A later failure rolled back the new block, and nothing put the old one back. No file routed Bob. What changed
How it was tested
CI
|
amiddavid
left a comment
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 2 (glm, user of @amiddavid) | GLM rits/zai-org/glm-5-3 via Claude Code 2.1.319 | offload-review skill, @amiddavid's session | fresh | 2 of 2 | 5 of 5 | 04b7f2f6ae5b |
approve |
Verdict: approve
The round-4 defect is fixed. 04b7f2f6 moves the old-block removal to the last step of setup, after the final write_record. A failed re-run now leaves the old block in place, so Bob stays routed. The new test covers the exact case both reviewers named. I found no new defect.
Findings
None.
Status of earlier findings
- Reviewer 1, round 4, finding 1, and my round-4 finding 1 (a failed re-run after a shell change leaves Bob routed nowhere): fixed in
04b7f2f6. I traced the failure path inbob_plugin.py:635-671:- First setup under bash: record names
.bash_profile,rc_created=True. Re-run under zsh: the new block goes into~/.zshrc, thenbob_hooks.installraises. undo.runnow runs with the old block untouched:had["hooks"]is True, so hooks stay;had["rc"]is False for the new file, so~/.zshrcis removed (the run created it with only our block, sorc_created=Truedeletes it — correct, it did not exist before); the old plist goes back;write_record(old_record)restoresrc_file=~/.bash_profile. Every file matches the record.- The removal call moved out of the
rc_file is not Nonebranch to:665, with the sameold_rc and not same_rcguard. The addedrc_file is not Nonecheck keeps the old meaning. The success path is unchanged:test_a_shell_change_removes_the_bash_profile_setup_had_created(test_bob_plugin.py:618-632) still passesold_rc_block=removed. - The probe-miss path (
installed_not_verified, exit 1) runs after thetry, so the old block is already gone there. That is right: the new route is fully in place, and both blocks name the same port. - The new test
test_a_failed_shell_change_keeps_the_old_rc_block(test_bob_plugin.py:603-616) fails on the old code, because the old code removed the block beforebob_hooks.installran.
- First setup under bash: record names
- Reviewer 1, round 1, finding 1 (
getJsonhang): still fixed. No commit since round 4 touches the status bar. - My round-1 finding 1 (data-dependence row): still fixed. The new commit changes no read.
- Round-4 non-blocking notes (the
:594docstring, the empty-~/.zshrcrc_createdtest, the fish case): no change. All still non-blocking.
Non-blocking
- The docstring at
bob_plugin.py:594still names a safety net that does not exist. It says "uninstall still names the old file in old_rc". No code writes anold_rckey to the record. With the new order, theOSErrorbranch of_remove_old_rc_blockcan only fire at the very end of a successful setup, and the record then names the new file. Uninstall andreset.shnever touch the old file again. Both round-4 reviews raised this. Fix the docstring, or storeold_rc_filein the record when the removal fails. The old block routes to the same port, so the risk stays small. - A Ctrl-C during the final removal can still leave no route.
KeyboardInterruptis not caught by_remove_old_rc_block(:598), so it reaches the outer handler, andundo.runremoves the new block. If the interrupt lands afterbob_route.removereplaced the old file (bob_route.py:264-268), no file routes Bob. The window is one atomicos.replaceat the end of a successful run, so this is a note, not a finding. Snapshotting the old file, asold_configdoes, would close it. - CI failures outside this PR. The author reports
build-testfails on timing tests in packages this PR does not touch, and the docsbuildfails on main too. Per the repo rules, these need their own issues, not a fix here. Consider filing them, so they are not lost.
What I checked
- Last review: round 4,
6fa1627e64ed7ea771b97197bfd9a8162d8e7cce, 2026-11-09T15:51:59Z - New commits read: 1 (
04b7f2f6fix(bob-plugin): keep the old rc block until setup succeeds) - Read in full: 7 reviews, 4 comments, 0 inline comments (from the three files)
- New items since my last review:
- Commit
04b7f2f6: I read the full diff and the code around it: all of_setup_changes,_remove_old_rc_block,Undo.runand_undo, andbob_route.install,remove,is_routed,_atomic_write. I traced the failure path (see above), the success path, the probe-miss path, and a first-ever setup. - Comment by amiddavid at 16:42:30Z ("Round 4: fixed in 04b7f2f"): each claim matches the diff. The CI failures it reports are in packages this PR does not touch (see Non-blocking).
- The new test: I checked its shape against the other shell-change tests. The first bash setup expects exit 0 with a real probe, as
test_setup_starts_the_service_then_routes_and_verifiesdoes. The zsh re-run stubs the probe, as6fa1627etaught. The assertion targets the old.bash_profile, the file the defect was about.
- Commit
- I did not run the tests. Live tests are not approved, and Go is not installed here.
amiddavid
left a comment
There was a problem hiding this comment.
| Reviewer | Kind | Started by | Context | Review | Round | Head | Verdict |
|---|---|---|---|---|---|---|---|
| Reviewer 1 (glm, user of @amiddavid) | GLM rits/zai-org/glm-5-3 via Claude Code 2.1.319 | offload-review skill, @amiddavid's session | fresh | 1 of 2 | 5 of 5 | 04b7f2f6ae5b |
approve |
Verdict: approve
The round-4 defect is fixed. 04b7f2f6 moves the old-block removal to the last step of setup, after the final record write. A failed re-run after a change of shell now leaves the old block in place, and Bob stays routed. The new test pins this.
Findings
None.
The fix in 04b7f2f6
- Correct placement.
_remove_old_rc_blocknow runs afterwrite_record(record)withrecord["complete"] = True(bob_plugin.py:663-666). Before, it ran right afterbob_route.install, so a later failure rolled back the new block and left no route. - Failure trace, verified. A zsh re-run that fails at
bob_hooks.install:Undo.runkeeps the hooks (had["hooks"]is True from the first setup), removes only the new.zshrcblock (had["rc"]is about the new file), puts back the old plist, and restores the old record. That record names.bash_profile, which still holds the block. So the record and the files agree, and Bob stays routed. - The new test is right.
test_a_failed_shell_change_keeps_the_old_rc_block(test_bob_plugin.py:603): the outerwithstubsfind_binaryandfirst_free_portfor both runs, andFakeProxystays up, so the second run reaches the hooks step. It asserts exit 1,result=setup_failed, and that.bash_profilestill routes. On the old code the removal ran before the hooks step, so the test fails there. The author confirms this. - Other paths checked. A failure at the escape hatch, the status bar, or the final
write_recordnow also leaves the old block. The probe-miss path (installed_not_verified) still removes the old block, and that is safe: the new block is in the file.RouteRefusedandOSErrorinside_remove_old_rc_blockare caught there, so they do not fail setup.
Non-blocking
- The docstring at
bob_plugin.py:594still names a safety net that does not exist. It says "uninstall still names the old file in old_rc". Noold_rckey goes into the record (grep old_rcfinds only setup and the docstring). When the old-block removal fails withOSError, the old block stays, and uninstall andreset.shnever touch it. Same note as round 4, still open. For an edited block, leaving it is right. - A Ctrl-C inside
_remove_old_rc_blockitself can still leave no route. The removal is atomic (_atomic_writeorunlink), but a Ctrl-C after it and before the call returns lands in the rollback: the old block is gone, and undo removes the new block. The window is now the removal call only. Before this commit it was the whole stretch after the rc install. This is inherent to the fix both reviewers proposed. Note only. - A move to a shell with no rc file (fish) still leaves the old block.
rc_fileisNone, so the removal never runs. Reviewer 2 raised this in round 4. The risk is small: fish does not read.bash_profile. - The
rc_createdempty-file case still has no test. Reviewer 2's round-4 note. A user-owned empty.zshrcmust survive uninstall. - Older notes (Makefile comment line,
MINIMUM_BOB_RELEASE,priced/moneyin the data-dependence row, the probe under nounset, adoctorwarn for a legacy block): no change, all non-blocking.
Status of earlier findings
- Round 4, finding 1 (both reviewers, the same defect): fixed in
04b7f2f6. See above. - Round 1, reviewer 1, finding 1 (
getJsonhang): still fixed.client.tsis unchanged since round 2. - Round 1, reviewer 2, finding 1 (data-dependence row): still fixed. The new commits change no read path.
What I checked
- Last review: round 4,
6fa1627e64ed7ea771b97197bfd9a8162d8e7cce, 2026-11-09T15:51:17Z - New commits read: 1 (
04b7f2f6fix(bob-plugin): keep the old rc block until setup succeeds) - Read in full: 8 reviews, 4 comments, 0 inline comments (from the three files)
- New items since my last review:
- Reviewer 2's round-4 review (15:51:59Z): read in full. Its finding 1 is the same defect as mine. Its 4 non-blocking notes: I checked each one myself (see Non-blocking). The docstring, fish and empty-
.zshrcnotes are still open. The note on the author's 15:46 comment is settled by the new comment. - The author's comment "Round 4: fixed in 04b7f2f" (16:42:30Z): I checked each claim against the diff. The fix and the test match. The test count 180 fits 179 plus one new test. The CI failures it names (
TestStatuslineGoldenWeeklyTip,TestKeepAliveSendsTheSweepQuestionInPlaceOfTheNextPing,TestDashboardAddsNoRequestLatencyWithContentCapture, docs nav) sit in packages this branch does not touch: the branch diff isbob-plugin/plus one docs line, 30 files. - Commit
04b7f2f6: I read the diff and the code around it: all of_setup_changes,_remove_old_rc_block,Undo.runandUndo._undo, andbob_route.install/remove/is_routed. I traced the failure path step by step (see above). I read the new test and theTempHome/FakeProxyhelpers it relies on, to confirm the second run reaches the hooks step.
- Reviewer 2's round-4 review (15:51:59Z): read in full. Its finding 1 is the same defect as mine. Its 4 non-blocking notes: I checked each one myself (see Non-blocking). The docstring, fish and empty-
- I did not run Go, Python or npm tests. Live tests are not approved, and Go is not installed here.
The test from #968 already pins the order: setup removes the old block only after the last step that can fail. The new test ran the same steps. Move its 3 extra checks into the #968 test and delete the new test: - the rollback reports rolled_back=true; - setup does not report old_rc_block=removed; - the user's own .zshrc is byte-identical after the rollback. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Vitaly Zabershinsky <[email protected]>
) The test for a failed re-run after a change of login shell (test_a_failed_shell_change_keeps_the_old_rc_block, from #968) now also checks the rollback report and the user's own .zshrc: the output has rolled_back=true, has no old_rc_block=removed, and .zshrc is byte-identical after the rollback. main already has the right order; this pins it. Behavior change: none (one test). Data dependence: none. Reviews: 2 offload reviews (Claude), round 2, both approve at 2f02885, which is the PR head. Signed-off-by: Vitaly Zabershinsky <[email protected]> Assisted-By: Claude Opus 5.5 <[email protected]>
Summary
This PR adds a context-guru plugin for IBM Bob: the Bob IDE (a VS Code fork) and Bob Shell. It does for Bob what the Claude Code plugin does for Claude Code:
macOS only.
What changed
Plugin (
bob-plugin/context-guru/)setupstatusdoctorupdateuninstallpreset-pickerofforlosslesscache-strategy-pickernoneonly. Keep-alive does not pay on BobHow it routes:
~/.zshrcor~/.bash_profile.VITE_GATEWAY_BASE_URL(Bob IDE) andBOB_GATEWAY_URL(Bob Shell).__CFBundleIdentifier, so only Bob reads it.setupwrites 2 into~/.bob/settings/settings.json.SessionStart: start the proxy.UserPromptSubmit: warn when the proxy is down.uninstallremoves only ours.127.0.0.1, ports 8891–8990. It is never bound to other interfaces.reset.sh: an emergency undo that works even with no install record.Status bar (
bob-plugin/statusbar/)A small VS Code extension, because Bob has no
statusLinesetting. It shows:CG ✓ ctx 21k/270k · cache 1h 54:18 · saved 0127.0.0.1and refuses any other host.make bob-statusbarbuilds the.vsix. The.vsixis gitignored.Other files
Makefile: thebob-statusbartarget.docs/data-dependence.md: a row for the Bob plugin.Data dependence
New row: "Bob plugin". Metadata only.
SessionStartsource.statuscannot see recent Bob trafficcomponents/all/datadep_test.gopasses.How it was tested
go test ./bob-plugin/: OK. It runs the 167 Python plugin tests and the status bar build check.launchctlandbobide.npm test, 47 of 47 pass.go vetandgofmt: clean.CG ✓in the status bar →/context-guru-statusgivesresult=ok→ uninstall..bash_profileandsettings.jsonmatched their SHA-256 from before.Known limits
~/.bob/playground, and Bob does not create that folder. Without it, the skills cannot run a command. The installer PR creates the folder.