Skip to content

Use modelId in assemble() for model-aware context packing #7

@lightcone0

Description

@lightcone0

Context

OpenClaw v2026.3.22 now passes modelId to context-engine assemble(). We accept it for compatibility (#6) but don't use it yet.

Opportunity

Use modelId to adapt context assembly per model:

  • Token budget scaling — pack more memories for models with larger context windows (e.g., 200K vs 8K)
  • Format adaptation — some models handle structured markdown better than others
  • Embedding-aware retrieval — adjust minScore thresholds based on known model characteristics

Scope

  • packages/apps/openclaw/src/context-engine.tsassemble() method
  • Potentially packages/core/src/components/context.tspack() could accept model hints

Priority

Low — current behavior works fine. This is an optimization for when we have data on how different models respond to different context formats.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions