feat(core): add skill_writing status for session learning flow#501
Merged
GenerQAQ merged 1 commit intomemodb-io:devfrom Mar 27, 2026
Merged
Conversation
Previously, session status went directly from "distilling" to "completed" after distillation, even though skill files were still being written by the skill agent. This caused confusion for clients waiting for learning to complete. New status flow: - pending → distilling → skill_writing → completed The "skill_writing" status indicates: - Distillation has completed successfully - SkillLearnDistilled message has been published to skill agent - Skill files are being written/updated This allows clients to: 1. Know exactly when distillation is done 2. Wait for actual skill file creation completion 3. Avoid race conditions when fetching newly created skill files Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why we need this PR?
Previously, session status went directly from "distilling" to "completed" after distillation, even though skill files were
still being written by the skill agent. This caused confusion for clients waiting for learning to complete.
Problem observed in logs:
[14:08:02] session 状态 = completed ← distillation done
[14:08:03] skills: files=1 ← but skill file not yet created
[14:08:15] skills: files=1 ← still not created
[14:08:26] skills: files=2 ← finally created (24s later!)
Clients thought learning was complete when
wait_for_learningreturned, but skill files were still being written.Describe your solution
Added a new
skill_writingstatus to the session lifecycle.New status flow:
pending → distilling → skill_writing → completed
Changes made:
skill_learner.py, set session status toskill_writingafter distillation completes and before publishing to skillagent
skill_writingstatus is automatically handled by existingwait_for_learninglogic (it's not in theterminalset, so clients will continue polling until
completed)After this PR:
[14:08:02] session 状态 = skill_writing ← distillation done, writing files
[14:08:26] session 状态 = completed ← skill files fully written
[14:08:26] wait_for_learning returns ← client can now safely fetch files
Implementation Tasks
skill_writingstatus update inprocess_skill_distillationwait_for_learninghandles the new status correctlyImpact Areas
Which part of Acontext would this feature affect?
Checklist
devbranch.