Skip to content

fix(memory): use ArchiveConfig.ArchivePrefix instead of hardcoded 'archive'#20

Merged
lIang70 merged 1 commit into
mainfrom
fix/archive-prefix-usage
Apr 19, 2026
Merged

fix(memory): use ArchiveConfig.ArchivePrefix instead of hardcoded 'archive'#20
lIang70 merged 1 commit into
mainfrom
fix/archive-prefix-usage

Conversation

@lIang70

@lIang70 lIang70 commented Apr 19, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Fix ArchiveConfig.ArchivePrefix which was defined but never actually used
  • Replace hardcoded "archive" subdirectory name in archiveDir() and manifestPath() with cfg.ArchivePrefix
  • The external prefix parameter (root directory) remains unchanged

Changes

  • archive.go: Pass archivePrefix (from cfg.ArchivePrefix) into archiveDir(), manifestPath(), intentPath(), writeIntent(), deleteIntent(), loadIntent()
  • tools.go: LoadManifest / LoadArchivedMessages callers now read t.deps.Config.Archive.ArchivePrefix
  • Tests: Updated to use new function signatures

Directory layout (unchanged by default)

{prefix}/{convID}/{ArchivePrefix}/manifest.json
{prefix}/{convID}/{ArchivePrefix}/messages_0_499.jsonl.gz
{prefix}/{convID}/{ArchivePrefix}/intent.json

Default ArchivePrefix = "archive" preserves backward compatibility.

Test plan

  • All memory package tests pass
  • All SDK tests pass

🤖 Generated with Claude Code

…chive"

ArchiveConfig.ArchivePrefix is defined with a default value of "archive"
but never actually consumed by any code path. The archive.go internal
helpers archiveDir() and manifestPath() hardcoded the "archive"
subdirectory name.

This change passes cfg.ArchivePrefix into archiveDir(), manifestPath(),
intentPath(), writeIntent(), deleteIntent(), loadIntent(), replacing
the hardcoded "archive" string. The external prefix parameter (root
directory) remains unchanged, consistent with other stores.

Directory layout (unchanged by default):
  {prefix}/{convID}/{ArchivePrefix}/manifest.json
  {prefix}/{convID}/{ArchivePrefix}/messages_0_499.jsonl.gz
  {prefix}/{convID}/{ArchivePrefix}/intent.json

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@lIang70
lIang70 merged commit 918236d into main Apr 19, 2026
8 checks passed
@lIang70
lIang70 deleted the fix/archive-prefix-usage branch April 19, 2026 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant