Skip to content

Conversation

chezsmithy
Copy link
Contributor

@chezsmithy chezsmithy commented Oct 15, 2025

Description

  • In the latest release anthropic has enabled a new memory tool solution that allows local repository memory to be automatically updated based on internal model decisions.
  • This PR implements the memory tool for the Bedrock provider, and OIA Bedrock adapter, as a tool.
  • For the vscode and intelliJ extensions it's enabled as an experimental tool.
  • for the CLI it's enabled as a default tool.

The tool is only enabled for the following models:

"claude-sonnet-4-5-20250929",      // Claude Sonnet 4.5
"claude-sonnet-4-20250514",        // Claude Sonnet 4
"claude-haiku-4-5-20251001",       // Claude Haiku 4.5
"claude-opus-4-1-20250805",        // Claude Opus 4.1
"claude-opus-4-20250514",          // Claude Opus 4

AI Code Review

  • Team members only: AI review runs automatically when PR is opened or marked ready for review
  • Team members can also trigger a review by commenting @continue-general-review or @continue-detailed-review

Checklist

  • I've read the contributing guide
  • The relevant docs, if any, have been updated or created
  • The relevant tests, if any, have been updated or created

Screen recording or screenshot

[ When applicable, please include a short screen recording or screenshot - this makes it much easier for us as contributors to review and understand your changes. See this PR as a good example. ]

Tests

Added tests as needed.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

4 issues found across 18 files

Prompt for AI agents (all 4 issues)

Understand the root cause of the following 4 issues and fix them.


<file name="extensions/cli/src/tools/memory.ts">

<violation number="1" location="extensions/cli/src/tools/memory.ts:130">
Creating a memory file in a new directory always fails: after creating the missing parent directory we throw `Path not found`, so fs.writeFile never runs. Drop the throw so the command can proceed.</violation>
</file>

<file name="core/tools/implementations/memory.ts">

<violation number="1" location="core/tools/implementations/memory.ts:121">
Core memory command handling logic duplicates extensions/cli/src/tools/memory.ts:executeMemoryCommand() and its handlers</violation>

<violation number="2" location="core/tools/implementations/memory.ts:131">
After creating a missing directory, this branch still throws `Path not found`, so the create command always fails for new paths.</violation>
</file>

<file name="extensions/cli/src/tools/index.tsx">

<violation number="1" location="extensions/cli/src/tools/index.tsx:141">
This enables the memory tool for any model containing “claude”, but the feature must be restricted to the specific allowlisted models from the PR description.</violation>
</file>

Since this is your first cubic review, here's how it works:

  • cubic automatically reviews your code and comments on bugs and improvements
  • Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
  • Ask questions if you need clarification on any suggestion

React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.

const fullPath = validatePath(args.path, memoryRoot);

if (!(await exists(fullPath))) {
throw new Error(`Path not found: ${args.path}`);
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Oct 21, 2025

Choose a reason for hiding this comment

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

Creating a memory file in a new directory always fails: after creating the missing parent directory we throw Path not found, so fs.writeFile never runs. Drop the throw so the command can proceed.

Prompt for AI agents
Address the following comment on extensions/cli/src/tools/memory.ts at line 130:

<comment>Creating a memory file in a new directory always fails: after creating the missing parent directory we throw `Path not found`, so fs.writeFile never runs. Drop the throw so the command can proceed.</comment>

<file context>
@@ -0,0 +1,416 @@
+  const fullPath = validatePath(args.path, memoryRoot);
+
+  if (!(await exists(fullPath))) {
+    throw new Error(`Path not found: ${args.path}`);
+  }
+
</file context>
Fix with Cubic

const fullPath = validateMemoryPath(pathArg, memoryRoot);

if (!(await exists(fullPath))) {
throw new Error(`Path not found: ${pathArg}`);
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Oct 21, 2025

Choose a reason for hiding this comment

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

After creating a missing directory, this branch still throws Path not found, so the create command always fails for new paths.

Prompt for AI agents
Address the following comment on core/tools/implementations/memory.ts at line 131:

<comment>After creating a missing directory, this branch still throws `Path not found`, so the create command always fails for new paths.</comment>

<file context>
@@ -0,0 +1,342 @@
+      const fullPath = validateMemoryPath(pathArg, memoryRoot);
+
+      if (!(await exists(fullPath))) {
+        throw new Error(`Path not found: ${pathArg}`);
+      }
+
</file context>
Fix with Cubic

});
}

return isClaudeModel;
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Oct 21, 2025

Choose a reason for hiding this comment

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

This enables the memory tool for any model containing “claude”, but the feature must be restricted to the specific allowlisted models from the PR description.

Prompt for AI agents
Address the following comment on extensions/cli/src/tools/index.tsx at line 141:

<comment>This enables the memory tool for any model containing “claude”, but the feature must be restricted to the specific allowlisted models from the PR description.</comment>

<file context>
@@ -106,10 +111,56 @@ function shouldExcludeEditTool(): boolean {
+        });
+      }
+
+      return isClaudeModel;
+    }
+  } catch (error) {
</file context>
Fix with Cubic

return [start, end];
}

export const memoryToolImpl: ToolImpl = async (args, extras) => {
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Oct 21, 2025

Choose a reason for hiding this comment

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

Core memory command handling logic duplicates extensions/cli/src/tools/memory.ts:executeMemoryCommand() and its handlers

Prompt for AI agents
Address the following comment on core/tools/implementations/memory.ts at line 121:

<comment>Core memory command handling logic duplicates extensions/cli/src/tools/memory.ts:executeMemoryCommand() and its handlers</comment>

<file context>
@@ -0,0 +1,342 @@
+  return [start, end];
+}
+
+export const memoryToolImpl: ToolImpl = async (args, extras) =&gt; {
+  const command = getStringArg(args, &quot;command&quot;) as MemoryCommand;
+  const memoryRoot = await ensureMemoryRoot(extras);
</file context>
Fix with Cubic

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

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

1 participant