Repository navigation
Conversation
`agentbricks --output json sessions unbind` printed the human success panel
(binding removed) or a "No session store binding" line (nothing bound),
so stdout was never valid JSON. Emit one JSON object in both cases:
{"session_store": null, "removed": <bool>, "manifest": "<agent.toml path>"}.
Default text output is unchanged; agent.toml is only rewritten when a
binding was actually removed.
Adds regression tests for JSON removal (with an unrelated memory binding
preserved), JSON with no binding (manifest unchanged), and unchanged text.
No cli.md or agent-bricks-workflow skill update: the command's options and
help text are unchanged, and the skill already directs `--output json`.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AgentBricksReviewerReview score: 100/100 · reviewers: 2/2 · Change risk: MODERATE · SummaryNo findings. Approach: The approach is sound and follows existing JSON-output patterns. More in Details. RiskChanges public CLI stdout consumed by scripts. The change is isolated to JSON-mode success output; text output and existing manifest-write behavior remain unchanged. Focused regression tests cover removal and no-op cases, but were inspected rather than executed. Reverting restores the prior behavior without a state migration. AI approvalReview checks passed ( DetailsApproach: The approach is sound and follows existing JSON-output patterns. It reuses the project mutation and rendering helpers, emits JSON after any required write succeeds, and returns before text rendering. No additional abstraction is warranted. Review rules: Diff size (computed): 2 files; +57 / -1 lines (58 changed text lines); 0 binary files.
ChangesThe implementation makes No CLI definitions or help strings change. Existing bundled guidance already recommends JSON for programmatic consumption, so documentation changes are unnecessary. TestsTest-by-test assessment
Tests, lint, and typechecking were not run during review: the environment lacked pytest, the installed package, and a package-local virtual environment. The author's reported passes were not independently verified. The tests adequately cover the handler change by inspection. Root-CLI cases for output-option placement would strengthen end-to-end coverage; a write spy would directly prove that no-op unbinding does not rewrite the manifest. ScopeAll changes support the stated JSON-output fix. No unrelated changes were found. Leaving Automated review by AgentBricksReviewer for |
There was a problem hiding this comment.
Auto-approved by AgentBricksReviewer for 20807f7: change risk medium (advisory; see the review comment for rationale), review score at least 95, every reviewer delivered, no blocking, security, or uncertain findings, at most 500 changed lines, and no CI, dependency, or credential files. Pushing new commits dismisses this approval. Workflow run
agentbricks --output json sessions unbindignored the selected output mode. If a binding was removed, it printed the Rich success panel. If none was bound, it printedNo session store binding in …/agent.toml.. Either way, stdout was not JSON, and both cases exited 0, so a script couldn't tell them apart.With
--output json(before or after the subcommand),sessions unbindnow prints exactly one JSON object in both cases:{"session_store": null, "removed": true, "manifest": "/path/to/agent.toml"} {"session_store": null, "removed": false, "manifest": "/path/to/agent.toml"}This follows the
removedflag thatmodels unbindandprompts unbindalready return. The default text output is unchanged. agent.toml is still rewritten only when a binding is actually removed, and other tables ([agent],[memory_store],[tracing]) are left untouched.Validation
sessions bind, then--output json sessions unbindtwice (bound, then unbound, including-o jsonafter the subcommand), then the same in text mode. Every command exited 0, and each JSON stdout parsed as a single object withremoved: trueand thenremoved: false. Text mode still shows the "Removed session store binding" panel with its redeploy next step, and still prints the "No session store binding" line. Apart from[session_store], agent.toml was identical to the starting file after every step. Before this change, both JSON unbind calls failed to parse (Expecting value).tests/unit_tests/bind_cli_test.pycover JSON removal with an unrelated memory binding preserved, JSON when nothing is bound (manifest unchanged), and unchanged text output. The two JSON tests fail without the fix. All 10 tests in the file pass with it. I checked formatting by hand against the 100-column limit; CI runs Ruff, ty and the full suite.No
cli.mdoragent-bricks-workflowskill update: the command's options and help text are unchanged, and the skill already says to use--output jsonfor programmatic use.memory unbindhas the same issue and is left for a separate change.Rollback: revert this commit.
🤖 Generated with Claude Code