Skip to content

fix(ingest): coerce YAML date/int tags to str in get_tags_from_frontmatter#31

Open
ruoxi001 wants to merge 1 commit into
ClaudioDrews:mainfrom
ruoxi001:fix/yaml-date-tags
Open

fix(ingest): coerce YAML date/int tags to str in get_tags_from_frontmatter#31
ruoxi001 wants to merge 1 commit into
ClaudioDrews:mainfrom
ruoxi001:fix/yaml-date-tags

Conversation

@ruoxi001

Copy link
Copy Markdown

Summary

Fixes AttributeError: 'datetime.date' object has no attribute 'lower' when wiki frontmatter contains ISO date tags like tags: [foo, 2026-06-12].

Fix

Coerce every non-None tag entry through str(...) in get_tags_from_frontmatter() before using .lower(). Also handles int, float, and bool scalars for safety.

Repro

tags: [important, 2026-06-12]
---
# any content

-> worker raises AttributeError

After

Same frontmatter -> tags = ["important", "2026-06-12"]

… docker-compose and setup.sh

The worker container could not be configured to use an alternative
embedding backend (Ollama, vLLM, etc.) because docker-compose.yml
did not pass through EMBEDDING_API_BASE, EMBEDDING_MODEL, or
EMBEDDING_API_KEY. The worker code (embedding.py) already reads
these env vars — only the compose file was missing the plumbing.

Changes:
- docker-compose.yml: add 3 env vars to worker.environment with
  defaults preserving current OpenRouter/Qwen3 behavior
- setup.sh: add_env for all 3 vars (consistency with EMBEDDING_DIMS)

Closes ClaudioDrews#29
@spongerius

Copy link
Copy Markdown

Code review

Found 2 issues:

  1. PR fix(ingest): coerce YAML date/int tags to str in get_tags_from_frontmatter #31 is a byte-for-byte duplicate of already-merged PR fix: expose embedding backend env vars in docker-compose and setup.sh #30 (fix: expose embedding backend env vars in docker-compose and setup.sh #30). The same embedding environment variables were already added to docker-compose.yml and setup.sh in commit e03db1f.

EMBEDDING_API_BASE: ${EMBEDDING_API_BASE:-https://openrouter.ai/api/v1}
EMBEDDING_MODEL: ${EMBEDDING_MODEL:-qwen/qwen3-embedding-8b}
EMBEDDING_API_KEY: ${EMBEDDING_API_KEY:-}

memory-os/setup.sh

Lines 331 to 333 in 86816e4

add_env "EMBEDDING_API_BASE" "https://openrouter.ai/api/v1"
add_env "EMBEDDING_MODEL" "qwen/qwen3-embedding-8b"
add_env "EMBEDDING_API_KEY" ""

  1. PR title and description claim to fix get_tags_from_frontmatter() to coerce YAML date/int tags to strings, but the actual diff only adds embedding environment variables (EMBEDDING_API_BASE, EMBEDDING_MODEL, EMBEDDING_API_KEY) to docker-compose.yml and setup.sh. No ingestion code is modified.

EMBEDDING_API_BASE: ${EMBEDDING_API_BASE:-https://openrouter.ai/api/v1}
EMBEDDING_MODEL: ${EMBEDDING_MODEL:-qwen/qwen3-embedding-8b}
EMBEDDING_API_KEY: ${EMBEDDING_API_KEY:-}

memory-os/setup.sh

Lines 331 to 333 in 86816e4

add_env "EMBEDDING_API_BASE" "https://openrouter.ai/api/v1"
add_env "EMBEDDING_MODEL" "qwen/qwen3-embedding-8b"
add_env "EMBEDDING_API_KEY" ""

🤖 Generated with Claude Code

- If this code review was useful, please react with 👍. Otherwise, react with 👎.

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.

2 participants