feat: mirror Codex recall settings - #117
Open
Tomauskasz wants to merge 9 commits into
Open
Conversation
Context: Allow Claude's SessionStart and prompt hooks to consume shared Codex recall settings and apply them across the repository and configured custom containers. Changes: - Load optional shared settings before Claude-specific overrides and expose memory counts, context budgets, and automatic-container configuration. - Fan out profile requests, tolerate partial container failures, globally rank and deduplicate prompt matches, and merge profile facts. - Bound complete prompt and SessionStart contexts, retain prompt filtering and session deduplication, and mark only emitted memories as recalled. - Document the configuration precedence and add multi-container, budget, partial-failure, and profile-merge coverage. Impact: Claude can use the same maxMemories, maxProfileItems, maxRecallTokens, maxPromptRecallTokens, autoRecallContainers, and customContainers values as Codex. Existing defaults remain five memories, five profile items per section, a 2,500-token context budget, and disabled automatic custom-container recall. Validation: - npm test: 27 tests passed. - Node syntax checks passed for all changed hook modules. - git diff --staged --check passed. - npm run lint exited successfully; the repository Biome configuration processed only biome.json and reported a schema-version information message. Notes: Prompt recall still uses /v4/profile. Open PR supermemoryai#114 independently proposes /v3/search and may require conflict resolution before merge. Signed-off-by: Tomas <180413002+Tomauskasz@users.noreply.github.com>
Context: Claude now mirrors Codex recall limits, automatic containers, and the saved API endpoint when both clients use the same key. Claude-specific settings and explicit environment or project endpoint overrides remain authoritative. Changes: - Allowlist the six shared recall options and require a literal boolean for automatic container search. - Globally rank and deduplicate search results, cap profile sections independently, and budget complete rendered prompt and SessionStart context. - Track only emitted memories as seen and preserve complete wrappers when the final item is truncated. - Prefer actionable non-404 failures when all container requests fail. - Reuse loaded settings and project configuration across recall hooks. - Mirror Codex's saved API base URL only for an identical active key. - Document the shared configuration contract and add regression coverage for precedence, caps, deduplication, failure selection, endpoint matching, and context budgets. Impact: Claude can use the same expanded recall configuration and self-hosted Supermemory endpoint as Codex without importing unrelated Codex behavior or redirecting a different Claude credential. Validation: - `npm test`: 36 tests passed. - Local marketplace `npm test`: 21 tests passed. - Node syntax checks passed for all changed hook files. - `npm run lint` exited successfully. - `git diff --staged --check` passed. - Live prompt recall returned 2,525 characters and 15 memories from both configured custom containers. - Live SessionStart returned 4,491 characters and 30 profile facts from both configured custom containers. Notes: Biome reports its existing schema-version informational mismatch; no lint error was reported. Signed-off-by: Tomas <180413002+Tomauskasz@users.noreply.github.com>
Context: Shared Codex configuration and credentials now fail open at the optional-file boundary without exposing parser input, and bounded recall records only memory text that reached the emitted context. Changes: - Validate shared JSON as a non-array object and redact parse diagnostics. - Ignore invalid mirrored endpoints, preserve explicit endpoint precedence, and normalize Codex-valid custom containers with empty descriptions. - Track truncated facts only after fact content is emitted. - Route the status command through the runtime credential and endpoint resolvers and remove the inspector's stale directive projection. - Add credential, endpoint, capture, status, deduplication, and minimum-budget coverage, split across focused test files with shared fixtures. Impact: Malformed optional Codex files no longer disable Claude recall or capture. Matching credentials reuse only valid mirrored endpoints. Status probes the same endpoint as recall and writes. Prefix-only context cannot suppress an un-emitted memory. Validation: - `npm test`: 44 tests passed. - `npx biome ci .`: passed. - Node syntax checks passed for changed JavaScript and test modules. - Bun bundled `plugin-inspector.ts` successfully. - `git diff --staged --check`: passed. Notes: None.
Context: Prompt recall treated truncated memories as fully seen, accepted finite negative relevance scores, and let the status command use a divergent request path and binary authentication result. The Biome gate also excluded the repository paths changed by the pull request. Changes: - Persist the exact emitted recall fragment and reject finite scores below the relevance threshold. - Reuse the shared profile transport in the status probe and report indeterminate HTTP failures with authenticated set to null. - Split status, SessionStart, and capture tests into owner-specific modules and add regressions for truncation, score filtering, trailing-slash routing, and status classification. - Point Biome at the plugin, tests, inspector, and package manifest, then apply its formatting and import organization to the collected files. Impact: Partially emitted memories remain eligible until their complete text fits. Automatic recall excludes negatively scored results. Status requests now match runtime URL handling and distinguish rejected credentials from unavailable or rate-limited APIs. CI now checks 34 repository files instead of skipping the changed implementation. Validation: - npm ci completed with zero vulnerabilities. - npm test passed 46 tests with zero failures. - npx biome ci . passed across 34 files. - Node syntax checks passed for every changed JavaScript and MJS entrypoint. - Bun bundled plugin-inspector.ts successfully. - git diff --cached --check passed. Notes: GitHub Actions for first-time fork commits still requires upstream workflow approval; local commands match the CI workflow. Signed-off-by: Tomas <180413002+Tomauskasz@users.noreply.github.com>
Require the profile endpoint to return its expected HTTP 200 status so the shared transport preserves 201 and 204 as indeterminate authentication results instead of rewriting them to success. Add regressions for unexpected successful responses and keep the status probe tri-state contract intact. Signed-off-by: Tomas <180413002+Tomauskasz@users.noreply.github.com>
Route the remaining capture, prompt-recall, and SessionStart setup through makeAuthedHome so credentials have one test-fixture owner. Signed-off-by: Tomas <180413002+Tomauskasz@users.noreply.github.com>
Signed-off-by: Tomas <tomas.bitvinskas@copla.com>
Signed-off-by: Tomas <tomas.bitvinskas@copla.com>
Signed-off-by: Tomas <tomas.bitvinskas@copla.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
~/.codex/supermemory.json, then apply Claude-specific overrides from~/.supermemory-claude/settings.json.Why
Claude and Codex can use one recall configuration and the same self-hosted endpoint. Unrelated Codex settings do not alter Claude, and a different Claude credential is not redirected to Codex's endpoint.
Review remediation
Verification
npm test: 47/47 passed.npx biome ci .: 34 files checked, no errors.plugin-inspector.ts.git diff --checkpassed.coding_personalandcopla_company, returned 15 globally capped memories, and stayed within the configured prompt budget.Compatibility
/v4/profile. Open PR fix: recall via /v3/search so self-hosted backends inject matches #114 independently proposes/v3/search; the two changes may require conflict resolution.Implementation prepared with AI assistance and reviewed and verified by the contributor.