CONV-002: Multi-turn Context Management #132
Labels
No labels
blocked:children
blocked:commit-ready-failed
blocked:depends-231
blocked:depends-236
blocked:depends-237
blocked:depends-238
blocked:depends-239
blocked:gate-fetch
blocked:gate-fetch
blocked:gate-lint
blocked:gate-research
blocked:needs-attention
blocked:needs-decision
blocked:no-changes
blocked:no-procedure
blocked:preflight
blocked:verify-failed
bug
enhancement
feature-request
high-priority
in-progress
lint-cleanup
needs-decompose
needs-triage
ops-retry
ops-task
phase-5
quickfix
security/medium
self-building
triage-approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Mark/mesh-seed#132
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Overview
Workers can access and utilize previous turns in a conversation for context-aware responses.
Current State
Workers receive isolated intents with no history.
Missing Components
Context Retrieval
Context Injection
Worker API
Acceptance Criteria
Related
Priority
HIGH - Required for chat-like interactions
Research Analysis Complete
Systematic investigation of the codebase produced a structured analysis covering:
1. Current Architecture
intent.discovered(Redis backplane) →mesh_node._on_intent_discovered()→BidManager.bid()→WorkerSpawner.spawn()→EphemeralWorker→PrimitiveLoader.execute()→ LLM call →result.committedid,type,payload,budget. Nothread_id,conversation_id, orparent_intentexists in the flow.EphemeralWorkerruns assubprocess.Popen, receives intent viaINTENT_ID/INTENT_PAYLOADenv vars, callsllm_complete(prompt)with a single string (no message array).intentstable has nothread_id,conversation_id,parent_intent_id,turn_number.2. Missing Components
thread_idin intent payload, ledger, backplane messages3. Recommended Implementation (5 phases)
intentstable withthread_id,parent_intent_id,turn_number; addIntentRepository.get_thread_context()andget_by_thread()thread_id; Mesh Node extracts and passes toWorkerSpawner.spawn()WorkerSpawnerpassesTHREAD_ID,THREAD_CONTEXT_JSONenv vars;EphemeralWorkerparses and retrievesPrimitiveExecution.build_*_prompt()acceptscontext;LLMRegistryaddsllm_chat_complete(messages[])for conversation formatsupports_multi_turn: true; worker emitsthread.updatedon completion4. Key Design Decisions
[{"role": "user", "content": "..."}, ...]supports_multi_turnin template.yaml5. Integration Points
substrate/ledger/schema.pyintentssubstrate/ledger/repositories/intent.pydocker/api_gateway.pythread_idin/intentPOSTdocker/mesh_node.pydocker/worker_spawner.pyTHREAD_ID,THREAD_CONTEXTenv varsdocker/ephemeral_worker.pyruntime/primitive_execution.pybuild_*_prompt()accepts contextsubstrate/llm_registry.pyllm_chat_complete(messages)6. Dependencies & Risks
DEFAULT ''columns andALTER TABLEinSchemaManager._add_column_if_missing()max_tokensin retrieval; truncate oldest first7. Test Strategy
IntentRepository.get_thread_context()with mocked ledgerthread_idFull analysis log:
/tmp/kilo-gsd-mesh-seed-132-research.logClosing this research ticket — implementation can be tracked as follow-up issues.