OpenViking icon indicating copy to clipboard operation
OpenViking copied to clipboard

[Bug]: session_skill_extraction_enabled is a no-op when Agent Evolution is on and a commit has no training cases

Open wutongyuonce opened this issue 3 months ago • 1 comments

Issue Origin

Inferred by an AI agent and not observed or reproduced

Bug Description

memory.session_skill_extraction_enabled is documented as an independent opt-in: when enabled, session commit also extracts reusable skills into the current user's skill directory. Agent Evolution (on by default) extracts training cases / trajectories / experiences.

These two outputs are separate types. Skills are not in AGENT_EVOLUTION_MEMORY_TYPES. The commit result already reports session_skills_extracted separately from memories_extracted.

Under the default agent_evolution_enabled=True path, turning the skill flag on does not extract skills unless that same commit also produced training cases.

Steps to Reproduce

  1. Leave Agent Evolution at the default (enabled).
  2. Set memory.session_skill_extraction_enabled: true.
  3. Commit a normal conversation that does not produce any training cases.
  4. Inspect session_skills_extracted / the user skill directory.

Expected Behavior

The commit still runs extract_session_skills and may write skill files. No training cases only means this conversation is not a training sample; it does not mean there is no reusable skill.

Actual Behavior

extract_long_term_memories takes the Agent Evolution branch and only calls train_from_extracted_cases. That function returns immediately when cases is empty, before it reads session_skill_extraction_enabled. The standalone extract_session_skills path is behind elif not agent_evolution_enabled. Result: session_skills_extracted: 0, no error.

Minimal Reproducible Example

Dispatcher in openviking/session/compressor_v3.py (extract_long_term_memories):

  • Evolution on → train_from_extracted_cases only
  • Evolution off + skill flag on → extract_session_skills
  • train_from_extracted_cases early-returns on if not cases: before skill_enabled is read

Config field (openviking_cli/utils/config/memory_config.py):

When enabled, session commit also extracts reusable skills from the archived conversation and writes them into the current user's skill directory.

extract_session_skills docstring: "Extract reusable skills without producing Agent Evolution memories."

OpenViking Version

origin/main @ a8380147a

Python Version

3.10+

Operating System

macOS

Additional Context

I am willing to contribute. Proposed fix: after the Evolution branch, if the skill flag is on, self memory is allowed, and train_result has no skill_uris key (the empty-cases early return does not set that key), call the existing extract_session_skills and merge URIs. If training already ran skill extraction (skill_uris present, including an empty list), do not call it again.

This was inferred from the current dispatcher, the config/docs wording, and tests/session/test_compressor_v3.py::test_v3_extracts_session_skills_when_agent_evolution_is_disabled. It has not been reproduced against a live server.

wutongyuonce avatar Sep 03 '26 12:09 wutongyuonce

Proposed fix in https://github.com/volcengine/OpenViking/pull/4658 — after the Agent Evolution branch, call existing extract_session_skills when the flag is on and train_result has no skill_uris key.

wutongyuonce avatar Sep 03 '26 12:09 wutongyuonce