Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions plugin/scripts/add-memory.cjs

Large diffs are not rendered by default.

46 changes: 23 additions & 23 deletions plugin/scripts/context-hook.cjs

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions plugin/scripts/save-project-memory.cjs

Large diffs are not rendered by default.

26 changes: 13 additions & 13 deletions plugin/scripts/search-memory.cjs

Large diffs are not rendered by default.

28 changes: 14 additions & 14 deletions plugin/scripts/summary-hook.cjs

Large diffs are not rendered by default.

22 changes: 3 additions & 19 deletions src/context-hook.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const {
} = require('./lib/container-tag');
const { loadSettings, getApiKey, debugLog } = require('./lib/settings');
const { readStdin, writeOutput } = require('./lib/stdin');
const { startAuthFlow, AUTH_BASE_URL } = require('./lib/auth');
const { formatContext, combineContexts } = require('./lib/format-context');
const { getUserFriendlyError, isBenignError } = require('./lib/error-helpers');

Expand All @@ -24,24 +23,9 @@ async function main() {
try {
apiKey = getApiKey(settings);
} catch {
try {
debugLog(settings, 'No API key found, starting browser auth flow');
apiKey = await startAuthFlow();
debugLog(settings, 'Auth flow completed successfully');
} catch (authErr) {
const isTimeout = authErr.message === 'AUTH_TIMEOUT';
writeOutput({
hookSpecificOutput: {
hookEventName: 'SessionStart',
additionalContext: `<supermemory-status>
${isTimeout ? 'Authentication timed out. Please complete login in the browser window.' : 'Authentication failed.'}
If the browser did not open, visit: ${AUTH_BASE_URL}
Or set SUPERMEMORY_CC_API_KEY environment variable manually.
</supermemory-status>`,
},
});
return;
}
debugLog(settings, 'No API key found; supermemory disabled');
writeOutput({ continue: true, suppressOutput: true });
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Breaking change: removes the only re-authentication path with no replacement.

startAuthFlow() is not called anywhere else in src/, and there is no /login command in plugin/commands/. This creates two concrete breakages:

  1. First-time users with no env var, no project config, and no ~/.supermemory-claude/credentials.json will silently get no memory — with no indication of how to set up their key beyond reading the README.

  2. Users who ran /claude-supermemory:logout are now stuck. logout.md explicitly tells them: "The next time a Supermemory hook runs, you'll be prompted to log in again via browser." After this change that promise is broken — the hook just silently continues with no memory and no prompt.

If the intent is to remove the auto-popup (reasonable for headless/CI environments), consider adding a /claude-supermemory:login command that explicitly triggers startAuthFlow(), and updating logout.md to point users there instead.

return;
}

const client = new SupermemoryClient(apiKey);
Expand Down