Skip to content

[agentbricks] Session delete cascades, store names match the service, chat app search reads results - #931

Open
nihit wants to merge 1 commit into
mainfrom
agentbricks-store-id-delete-chat-fixes
Open

nihit wants to merge 1 commit into
mainfrom
agentbricks-store-id-delete-chat-fixes

Conversation

@nihit

@nihit nihit commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

Three fixes for memory and sessions.

Session delete

  • The DeleteSession API has no force parameter: it always deletes the session's items and child sessions. The CLI's --force ("Cascade-delete descendant sessions"), Session.delete(force=False), and the README implied that without it child sessions were kept. Stop sending force; keep Session.delete(force=...) as a deprecated no-op that warns, and sessions delete --force as a hidden no-op with a note. The prompt now says "Delete session '' and all of its child sessions?".

Store names

  • Check names against the rules the managed store service enforces (conversation-store CreateManagedMemoryStoreHandler / CreateSessionStoreHandler): memory store IDs are 3-56 chars and start with a letter; session store names are 3-55 chars, may start with a digit, and can't start with "databricks". Both use lowercase letters, digits, and hyphens and end with a letter or digit; reserved names are rejected.
  • init default names always pass: a slug that starts with a non-letter or "databricks" gets an agent- prefix, and long slugs are shortened to fit both stores. Previously a project dir like 2024-q4-agent produced a memory store ID deploy couldn't create.
  • memory stores create and sessions stores create reject invalid names before calling the API; the session help said 3-63. init --memory-store/--session-store and both bind commands validate too. Memory bind also accepts a legacy display name that starts with a digit, since stores created before IDs were required can have one.
  • Deploy preflight rejects an invalid bound name before creating anything. For a legacy memory name it requires the store to exist, and reconcile now resolves such a store instead of trying to create it, which the service rejects.

Chat app

  • Memory search reads the ranked results array; the top-level managed_memory_entries copy is deprecated and is read only from servers without results.
  • Label ALWAYS_ON pipelines "Always on" instead of falling back to "Manual only".

Docs: README, cli.md, and the state-and-tools skill reference.

… chat app search reads results

Three fixes for memory and sessions.

Session delete
- The DeleteSession API has no `force` parameter: it always deletes the session's items
  and child sessions. The CLI's `--force` ("Cascade-delete descendant sessions"),
  `Session.delete(force=False)`, and the README implied that without it child sessions
  were kept. Stop sending `force`; keep `Session.delete(force=...)` as a deprecated no-op
  that warns, and `sessions delete --force` as a hidden no-op with a note. The prompt now
  says "Delete session '<id>' and all of its child sessions?".

Store names
- Check names against the rules the managed store service enforces
  (conversation-store CreateManagedMemoryStoreHandler / CreateSessionStoreHandler):
  memory store IDs are 3-56 chars and start with a letter; session store names are 3-55
  chars, may start with a digit, and can't start with "databricks". Both use lowercase
  letters, digits, and hyphens and end with a letter or digit; reserved names are rejected.
- `init` default names always pass: a slug that starts with a non-letter or "databricks"
  gets an `agent-` prefix, and long slugs are shortened to fit both stores. Previously a
  project dir like `2024-q4-agent` produced a memory store ID deploy couldn't create.
- `memory stores create` and `sessions stores create` reject invalid names before calling
  the API; the session help said 3-63. `init --memory-store/--session-store` and both
  `bind` commands validate too. Memory bind also accepts a legacy display name that starts
  with a digit, since stores created before IDs were required can have one.
- Deploy preflight rejects an invalid bound name before creating anything. For a legacy
  memory name it requires the store to exist, and reconcile now resolves such a store
  instead of trying to create it, which the service rejects.

Chat app
- Memory search reads the ranked `results` array; the top-level `managed_memory_entries`
  copy is deprecated and is read only from servers without `results`.
- Label ALWAYS_ON pipelines "Always on" instead of falling back to "Manual only".

Docs: README, cli.md, and the state-and-tools skill reference.

Co-authored-by: Isaac <no-reply@databricks.com>

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AgentBricksReviewer left 1 inline comment(s) on b424458. The score and summary are in the review comment.


@memory.command("bind")
@click.argument("store")
@click.argument("store", callback=memory_store_name(allow_legacy=True))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Binding now rejects previously accepted inputs without a compatibility waiver
HIGH · low confidence · Blocking issues

On a valid project, agentbricks memory bind "Bad Name" previously recorded the name locally; the new callback rejects it before updating the manifest. Although rejecting names that cannot be created is intentional, this still narrows a public CLI’s accepted inputs under BRIDGE-001, and the PR has no intentional-api-break label.

Fix: Preserve previously accepted binding inputs while validating creation separately, or obtain the intentional-api-break label required by BRIDGE-001.

Evidence

Verified-against: integrations/agentbricks/src/databricks_agentbricks/cli/memory.py:103-118, integrations/agentbricks/src/databricks_agentbricks/cli/store_names.py:17-27, integrations/agentbricks/src/databricks_agentbricks/projects/store_names.py:30-48, integrations/agentbricks/src/databricks_agentbricks/projects/agent_project.py:907-927; compared with the base callback-free argument and manifest-writing path. This finding concerns local binding compatibility, not whether the service accepts that name.

AgentBricksReviewer finding for b424458.

@github-actions

Copy link
Copy Markdown
Contributor

AgentBricksReviewer

Review score: 90/100 · reviewers: 2/2 · Change risk: HIGH · risk:high

Summary

Blocking issues

  • HIGH · memory.py:105 — Binding now rejects previously accepted inputs without a compatibility waiver

Approach: The shared validation approach is sound, apart from the compatibility-policy issue above. More in Details.

Risk

Changes affect public CLI validation, generated store names, deployment provisioning, session deletion requests, and both chat-app templates. Deletion remains irreversible, but this PR appears to clarify existing cascading behavior rather than introduce it. Unit tests cover the client-side branches; no tests or live service checks were executed during review. A revert restores code behavior, not deleted service data.

CI raised the reviewer's MODERATE to HIGH:

  • integrations/agentbricks/src/databricks_agentbricks/cli/init.py touches a public interface, runtime, or persisted state
  • integrations/agentbricks/src/databricks_agentbricks/cli/memory.py touches a public interface, runtime, or persisted state
  • integrations/agentbricks/src/databricks_agentbricks/cli/sessions.py touches a public interface, runtime, or persisted state
  • integrations/agentbricks/src/databricks_agentbricks/cli/store_names.py touches a public interface, runtime, or persisted state
  • integrations/agentbricks/src/databricks_agentbricks/clients/conversation_store_client.py touches a public interface, runtime, or persisted state
  • integrations/agentbricks/src/databricks_agentbricks/services/deployment/provisioners.py touches security, migration, deployment, or release behavior
  • integrations/agentbricks/src/databricks_agentkit/_api_client.py touches a public interface, runtime, or persisted state
  • integrations/agentbricks/src/databricks_agentkit/session_store.py touches a public interface, runtime, or persisted state
  • the change exceeds 10 paths

AI approval

Review checks not passed; not eligible for auto-approval. To unblock:

  • Fix the blocking issues above, or reply explaining why they don't apply, then comment /review (the score must reach 95).
  • Split the PR to at most 500 changed lines (it has 748).

Or ask a maintainer to approve.

Details

Approach: The shared validation approach is sound, apart from the compatibility-policy issue above. Pure naming helpers, thin Click callbacks, and separate search/list readers fit the existing boundaries. Keeping the public deletion deprecation shim also avoids an unnecessary SDK break.

Review rules: REVIEW.md, integrations/agentbricks/REVIEW.md at base 3fb97d7cd2f38d5dd01c8882c3a18674d57b79c1 · checked: BRIDGE-001–010, AGENTBRICKS-001–003, with dependency, release, and framework checks assessed as not triggered · gaps: backend naming constraints and cascade semantics were not independently verified; tests were inspected but not executed.

Diff size (computed): 23 files; +658 / -90 lines (748 changed text lines); 0 binary files.

Category Files Added Deleted Share of changed text lines
Tests and test support 8 396 43 58.7%
Documentation 3 22 8 4.0%
Dependencies and lockfiles 0 0 0 0.0%
Implementation / other 12 240 39 37.3%

Changes

The PR clarifies cascading session deletion and retains deprecated public force inputs, aligns store-name validation and scaffold defaults with the stated service rules, resolves legacy memory stores without attempting creation, and corrects chat-template search results and pipeline labels.

Implementation changes are accompanied by eight test files and updates to the README, CLI reference, and bundled workflow guidance. The test-heavy size is justified by the affected CLI, provisioning, SDK, and template surfaces. Helper-specific assertions could be consolidated into store_names_test.py without reducing coverage.

Tests

Test-by-test assessment
Test / case Behavior protected Layer Needed? Action / rationale
integrations/agentbricks/tests/unit_tests/agent_project_test.py Sanitized default store names and relocated helper Python unit consolidate Move helper-specific assertions beside the new naming tests while retaining coverage.
integrations/agentbricks/tests/unit_tests/cli_ergonomics_test.py Output-option parsing with valid store names CLI unit keep Updated fixtures prevent validation from masking existing ergonomics checks.
integrations/agentbricks/tests/unit_tests/cli_test.py Deprecated force option remains accepted but hidden CLI-definition unit keep Protects compatibility and help visibility.
integrations/agentbricks/tests/unit_tests/client_test.py Delete request omits the unsupported force query Mocked transport unit keep Exact request assertions protect the wire-level correction.
integrations/agentbricks/tests/unit_tests/session_store_test.py Public deletion shim warns for explicit booleans SDK wrapper unit keep Covers default deletion and deprecated argument forwarding.
integrations/agentbricks/tests/unit_tests/sessions_cli_test.py Cascade confirmation, cancellation, force notice, JSON output, validation CLI unit keep Exercises observable behavior and verifies cancellation avoids deletion.
integrations/agentbricks/tests/unit_tests/store_names_test.py Naming boundaries, defaults, legacy resolution, and preflight Pure and mocked workflow unit keep Covers the shared policy and provisioning branch selection.
integrations/agentbricks/tests/unit_tests/template_ui_memory_search_test.py Ranked results, fallback behavior, pipeline labels, reader wiring JavaScript helper execution and source checks keep Exercises both shipped templates; execution cases skip without Node.

No test execution is claimed. The supplied tests are appropriate for the client-side changes, but cannot establish actual backend naming or deletion semantics. If binding compatibility is preserved, add a regression case for the previously accepted local input.

Scope

All changes support the stated managed-store, session, and chat-app fixes. No unrelated changes were found.


Automated review by AgentBricksReviewer for b424458 · workflow run · comment /review to re-run

@github-actions github-actions Bot added the risk:high Change risk assessed by AgentBricksReviewer: high label Nov 28, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:high Change risk assessed by AgentBricksReviewer: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant