[Bug] Portable memory pack fails for agent IDs containing hyphens
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
Research direction
Read octop/api/common/memory_client.py and trace memory_namespace() into octop/api/routers/memory_portable.py, where the portable pack locates its source. Reproduce with a hyphenated agent ID and the SQLite backend. Done when packing finds the normalized tables and includes the agent's memory rows; the issue gives the successful repro result as 182 rows.
Written by the indexing model from the issue text.
Description
Description
Memory pack/adopt (and the dashboard "Migrate Memory" action) fails for any
agent whose agent_id contains a hyphen, e.g. problem-attack-expert.
The SQLite backend stores data under a normalized table prefix, but
memory_namespace() returns the un-normalized ID, so no source is found.
Environment
- Octop site-packages build, octop-memory 1.0.5, SQLite memory backend
- Agent renamed from a 6-letter ID to a hyphenated slug
Steps to reproduce
- Create/rename an agent to an ID containing
-(e.g.problem-attack-expert). - Ensure its memory.sqlite has raw_events, e.g.
agent_problem_attack_expert_raw_events. - Dashboard -> Migrate Memory -> Export, or
POST /api/agents/problem-attack-expert/memory/portable/pack
Actual result
ValueError: nothing to migrate: namespace 'agent_problem-attack-expert'
has no raw_events data.
Expected result
A pack containing the agent's memories (182 rows / 132528 bytes in the repro case).
Root cause
octop/api/common/memory_client.py:memory_namespace() returns
f"{_MEMORY_NS_PREFIX}{agent_id}" with the hyphen intact. The SQLite backend
normalizes a namespace into a table prefix via
re.sub(r"[^a-z0-9_]", "_", ns.lower()), so the real tables are
agent_problem_attack_expert_*. octop/api/routers/memory_portable.py
uses the un-normalized name to locate a source, finds none, falls back to a
SourceInfo with the bad namespace, and pack() then reports "nothing to migrate".
Verification
- ns
agent_problem-attack-expert-> ValueError - ns
agent_problem_attack_expert-> 182 rows / 132528 bytes, success
Suggested fix
Normalize inside memory_namespace():
return re.sub(r"[^a-z0-9_]", "", f"agent{agent_id}".lower())
Note: PR #3082 documents this normalization but does not touch
memory_client.py or memory_portable.py, so it does not cover this bug.
- Dominant language
- Python
- Stars
- 12.5k
- Forks
- 1.8k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 155
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from TencentCloud/Octop
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
TencentCloud/Octop#3089 ·
Maintainers usually reply within 1 day
-
[bug] Validate server certificates for mailbox SMTP and IMAP connectionsPossibly taken A pull request linked to this issue is open or already merged. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
TencentCloud/Octop#3077 ·
Maintainers usually reply within 1 day
-
[bug] browser stream normalizes about:blank to https://about:blank, breaking blank-tab startMay be free again @legend91019 claimed this 18 days ago, and no pull request is open. Open
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
TencentCloud/Octop#2891 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
TencentCloud/Octop#2889 ·
Maintainers usually reply within 1 day
-
octop user create --role 传入不存在的角色名时静默成功,创建出零权限用户May be free again @xxstar-01 claimed this 19 days ago, and no pull request is open. Open
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
TencentCloud/Octop#2862 · 2 comments ·
Maintainers usually reply within 1 day
All issues in TencentCloud/Octop
Similar issues
-
day_or=True union silently becomes the ISC cron AND bug when a day field expands to its full range (e.g. '0 0 */1 * */2' fires only Sun/Tue/Thu/Sat)Possibly taken @rahul05ranjan claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
pallets-eco/croniter#309 ·
Maintainers usually reply within 1 day
-
[Bug]: MLX text downloads omit the requested Hub token and cache directoryPossibly taken @abhijithneilabraham claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
vllm-project/vllm-metal#1423 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
linkedin/Liger-Kernel#1693 ·
Maintainers usually reply within 3 days
-
Growl: a server-rejected notification is reported as a successPossibly taken @rahul05ranjan claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
gke-labs/kube-agents#7441 ·
Maintainers usually reply within 1 day