Repository navigation
Add memory changes CLI for write history - #921
Conversation
AgentBricksReviewerReview score: 100/100 · reviewers: 2/2 · Change risk: MODERATE · SummaryNo findings. Approach: The approach is sound and follows existing command, transport, authentication, error-handling, and rendering patterns. More in Details. RiskAdds public CLI commands and authenticated history reads through the AgentKit transport. Requests are explicitly paginated and do not mutate persistent state, making rollback straightforward. Boundary tests cover request mapping and output, but canonical gateway routing and backend compatibility remain unverified by this review. AI approvalReview checks passed (
Or ask a maintainer to approve. DetailsApproach: The approach is sound and follows existing command, transport, authentication, error-handling, and rendering patterns. Keeping history-source normalization separate preserves the narrower source choices for entry creation. Explicit pagination avoids unbounded history traversal, and literal text rendering avoids interpreting memory content as Rich markup. Review rules: Diff size (computed): 7 files; +720 / -0 lines (720 changed text lines); 0 binary files.
ChangesAdds memory-change listing and detail commands, transport methods, help examples, CLI documentation, bundled workflow guidance, and unit tests. JSON preserves the response fields needed for predecessor lookup, including when an entry’s path changes. The size is justified by the filter, validation, pagination, and rendering cases. No dependency changes or concrete opportunities for substantial reduction were identified. TestsTest-by-test assessment
Both Claude and Codex delivered reviews covering correctness and public API behavior; all remaining lenses were checked. Offline probes exercised request mapping, pagination, normalization, and invalid inputs. The pytest suite was not run because pytest was unavailable; the PR’s reported test and CI totals were not independently verified. Mocked-boundary coverage is appropriate for the CLI changes. Canonical routing, backend filtering semantics, and authorization enforcement still require service-level evidence; the reported preview checks do not establish canonical gateway availability. ScopeAll seven changed files support read-only memory-history inspection. Implementation, tests, help, CLI reference, and workflow guidance serve the same outcome. No unrelated changes were found. Automated review by AgentBricksReviewer for |
The control-plane read API merged with a different shape from the one this CLI was written against: - ListMemoryChangesResponse names its list `memory_changes`, so the text table read from `changes` would show a store with history as empty. - GetMemoryChange is keyed by the change name alone. Drop get's --memory-entry-id, --path, --page-size, and --page-token. - ListMemoryChanges accepts `memory_entry_id`. Expose it as `changes list --memory-entry-id`, which is now how one entry's version history is read. Rename the client method to get_memory_change to match the RPC, and update the CLI reference, help examples, and workflow guidance to the new predecessor and entry-history flow. Co-authored-by: Isaac <no-reply@databricks.com>
|
Automatic push review attempt 3/3 reserved. Failed attempts count toward this limit. After the limit, comment |
AgentBricksReviewerReview score: 100/100 · reviewers: 2/2 · Change risk: MODERATE · SummaryNo findings. Approach: The approach is sound: a dedicated command module uses the existing private API client, authentication, rendering, and error-handling patterns. More in Details. RiskAdds public CLI commands and HTTP reads in AI approvalReview checks passed (
Or ask a maintainer to approve. DetailsApproach: The approach is sound: a dedicated command module uses the existing private API client, authentication, rendering, and error-handling patterns. Claude Code and Codex independently checked correctness, public API compatibility and UX, security, tests, architecture, performance, and operational safety. No materially simpler implementation was identified. Review rules: Diff size (computed): 7 files; +645 / -0 lines (645 changed text lines); 0 binary files.
ChangesAdds read-only memory-change listing and retrieval, transport methods, CLI registration and help, command documentation, workflow guidance, and unit tests. The implementation is additive, and JSON preserves returned fields. The size is justified by validation, output rendering, documentation, and parametrized coverage. No necessary reduction was identified. TestsTest-by-test assessment
The pytest suite was not executed because pytest was unavailable. Codex executed isolated, in-memory smoke checks against selected head definitions; those passed with HTTP and rendering mocked. Author-reported test totals, CI results, and live checks were not independently verified. Existing infrastructure tests plus the added unit tests provide relevant offline coverage, but do not establish deployed backend compatibility. ScopeAll seven changed files support memory-history inspection; no unrelated changes were found. The PR description overstates detail retrieval: Automated review by AgentBricksReviewer for |
- Drop the "requires memory history to be enabled" help line; callers cannot toggle it. Shorten the group summary to "Inspect memory write history." - Label each list reference with its kind (session:, run:, request:) so caller-chosen session ids and generated ids read consistently. - Add an actor column to the list table. List responses carry no actor, so it is read from each listed change (one request per row, text output only). - Stop printing the continuation token in text output. On a terminal the list offers the next page, as the store lists do; otherwise it says more changes are available. JSON still returns the token. - Give an example path in the invalid-path error. Co-authored-by: Isaac <no-reply@databricks.com>
AgentBricksReviewerReview score: 100/100 · reviewers: 2/2 · Change risk: MODERATE · SummaryNon-blocking notes
Approach: The approach is sound and follows existing CLI, transport, validation, and rendering patterns. More in Details. RiskAdds public memory-history CLI commands and backend GET requests. Text listing fetches each change’s details to populate actors, increasing request volume. Changes are read-only and readily reversible, with no persistence, dependency, or write-path changes. Unit coverage is substantial, but canonical backend routing and response semantics were not independently verified. AI approvalReview checks passed (
Or ask a maintainer to approve. DetailsApproach: The approach is sound and follows existing CLI, transport, validation, and rendering patterns. Actor enrichment adds a documented request per listed change; a metadata-only table would reduce requests but remove that functionality. JSON output avoids enrichment requests. Review rules: Diff size (computed): 7 files; +742 / -0 lines (742 changed text lines); 0 binary files.
ChangesAdds history transport methods, command registration, list/detail rendering, help examples, reference documentation, bundled workflow guidance, and focused tests. Listing supports filters and explicit continuation; detail retrieval displays a whole change and its immutable entry versions. The size is justified by validation, output-mode, pagination, and rendering coverage. No materially equivalent simplification or unnecessary production-code expansion was identified. TestsTest-by-test assessment
The Claude and Codex reviewers delivered reports covering both P0 lenses and all P1 lenses collectively. Six standalone offline smoke scenarios passed against head-loaded modules; these were not executions of the authored pytest suite. Pytest, Ruff, type checking, packaging, and live API checks were not independently rerun. The PR’s reported results remain author-provided evidence. Mocked responses cannot establish canonical routing or backend detail-response semantics; those require backend contract or live-service verification. ScopeAll seven changed files support read-only memory-history inspection. No unrelated changes were found. The scope clarification above concerns the description, not a demonstrated implementation defect. Automated review by AgentBricksReviewer for |
When a table's other columns were too wide for the terminal, Rich shrank the identifier column to nothing and kept the rest, so `memory changes list` showed no Change ID on a page with long actors and references but did on a page with short ones. Cap the non-identifier columns ourselves, widest first, so the identifier stays whole and every other column stays on screen, shortened. Co-authored-by: Isaac <no-reply@databricks.com>
Answering "what did this change do?" took two `changes get` calls plus jq and diff. With --diff, each entry version is followed by a line diff of its content against the version named by previous_change_id: removed lines in red, added in green, unchanged dimmed. A new entry is all added; a delete is all removed. Predecessors are read before anything is printed, and a predecessor without the entry is an error, so a failed read cannot produce a partial page or a wrong diff. --diff is text only and is rejected with -o json. The +N ~N -N entry counts are now green, amber, and red in both get and list. Co-authored-by: Isaac <no-reply@databricks.com>
AgentBricksReviewerReview score: 100/100 · reviewers: 2/2 · Change risk: MODERATE · SummaryNo findings. Approach: The approach is sound: it extends the existing CLI and authenticated transport without introducing another client or changing write behavior. More in Details. RiskAdds public memory-history commands and changes shared terminal-table sizing in AI approvalReview checks passed (
Or ask a maintainer to approve. DetailsApproach: The approach is sound: it extends the existing CLI and authenticated transport without introducing another client or changing write behavior. Text listing deliberately performs one additional, sequential full-change request per row to obtain actors; JSON output avoids that enrichment. The cost is documented. Removing actor enrichment would reduce requests, but would sacrifice a documented feature rather than provide an equivalent implementation. Review rules: Diff size (computed): 9 files; +779 / -0 lines (779 changed text lines); 0 binary files.
ChangesThe diff adds history command registration, a dedicated command module, transport methods and validation, help examples, command documentation, workflow guidance, tests, and shared table-width handling. The size is reasonable for the new command surface and its edge-case coverage. The shared renderer change has broader reach than the history commands, but supports keeping change identifiers usable. It could be separated for independent validation, although no unrelated behavior or verified regression was found. The PR description is stale: it promises exact-entry/path filters and pagination for TestsTest-by-test assessment
Existing and added tests provide good local contract coverage, but mocked responses cannot establish the deployed API schema or routing. The supplied diff checksum matched, and ScopeAll nine changed files support inspecting memory-write provenance and immutable entry versions. The documentation and bundled workflow guidance accompany the public CLI additions, satisfying AGENTBRICKS-001. No clearly unrelated changes, dependency changes, or write-path changes were found. Both Claude and Codex delivered reviews covering correctness and public API compatibility. Security, tests, architecture and maintainability, performance, and operational safety were also checked; no verified code defects survived counterexample checks and head verification. Automated review by AgentBricksReviewer for |
Text output of `changes get` now always shows each entry's content as a diff against its previous version, so seeing what a change did needs no flag. The --diff flag is removed; JSON output is unchanged and still makes a single request. Rename the per-entry heading from "Entry Version" to "Entry", and title the diff box "<path> diff". The previous change id is already in the entry's fields, so the title no longer repeats it. Co-authored-by: Isaac <no-reply@databricks.com>
What did you change, and why?
See CLI design and commands: https://docs.google.com/document/d/1BbV6TifUjdTdz1VydSAaphsWDuu3p7nCBKh_vO-EhRk/edit?tab=t.ddxygv1ljga2#bookmark=id.5ejewnrgocup
Memory writes can come from agent tools, Dreamer, or manual/API edits. Add CLI access to the memory changes APIs so users can inspect write provenance and retrieve immutable entry versions for comparison.
agentbricks memory changes list --store ...: change metadata, actor/source/literal path-prefix filters, and explicit pagination.agentbricks memory changes get CHANGE_ID --store ...: header and entry versions, exact entry/path filters, and entry pagination. JSON preservesprevious_change_id; users can retrieve the predecessor by entry identity even when its path changed.agent-bricks-workflowskill.Uses the canonical
/api/2.0/agents/memory-stores/{store}/changesendpoints and existing SDK authentication/error handling. Read-only; requires backend history enablement. No dependency, schema, or runtime write-path changes.How do you know it works?
ty checkpassed with all extras installed.stores_lookup_test.py::test_terminal_table_keeps_each_row_on_one_line_when_identifiers_fill_it, reproduced on unchangedmainate50cab5in the same environment; the history/CLI tests pass. No existing tests were disabled or changed.GitHub CI on
516edc6: 55 passed, 0 failed, 0 pending (tests, lint/type/format). The two automated reviewer/approval checks are skipped while this PR is draft.