Skip to content

Commit 6e30792

Browse files
committed
fix(integrations): gate Pi model tools on trust
Signed-off-by: phernandez <paul@basicmachines.co>
1 parent 3ce34e8 commit 6e30792

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

integrations/pi/extensions/index.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,9 @@ export default function basicMemoryPi(pi: ExtensionAPI): void {
508508
async execute(_toolCallId, params: { title?: string }, signal, _onUpdate, ctx) {
509509
await refreshConfig(ctx);
510510
requireValidConfig();
511-
if (!hasProjectMapping()) throw new Error("Basic Memory project is not configured");
511+
if (!canUseProjectAutomatically()) {
512+
throw new Error("Basic Memory workspace automation is not trusted");
513+
}
512514
const message = await captureSession(cfg, ctx, params.title, signal);
513515
return { content: [{ type: "text", text: message }], details: { transport: cfg.transport } };
514516
},
@@ -525,7 +527,9 @@ export default function basicMemoryPi(pi: ExtensionAPI): void {
525527
async execute(_toolCallId, params: { query?: string }, signal, _onUpdate, ctx) {
526528
await refreshConfig(ctx);
527529
requireValidConfig();
528-
const content = hasProjectMapping() ? await buildRecall(cfg, params.query, signal) : SETUP_GUIDANCE;
530+
const content = canUseProjectAutomatically()
531+
? await buildRecall(cfg, params.query, signal)
532+
: SETUP_GUIDANCE;
529533
return { content: [{ type: "text", text: content }], details: { transport: cfg.transport } };
530534
},
531535
});

0 commit comments

Comments
 (0)