fix: improve Steward delegation instructions for Librarian
Build and Push / build (release) Successful in 10s
Build and Push / build (release) Successful in 10s
- Update Librarian capability description to highlight CREATE/UPDATE/SEARCH - Add specific Steward guidelines for wiki creation, updates, and research - Add dynamic time injection to user prompts for temporal awareness - Expand domains to include 'create', 'write', 'update' - Update test to match new capability description 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -4,6 +4,7 @@ Request preprocessing pipeline.
|
||||
Analyzes requests via the Steward and creates scoped toolsets for Tatlock.
|
||||
"""
|
||||
from dataclasses import dataclass
|
||||
from datetime import datetime
|
||||
from typing import Any, Optional
|
||||
|
||||
from src.agents.steward import analyze_request, format_steward_note
|
||||
@@ -14,6 +15,23 @@ from src.core.logging_config import get_logger
|
||||
logger = get_logger(__name__)
|
||||
|
||||
|
||||
def _inject_temporal_context(request: str) -> str:
|
||||
"""
|
||||
Append current time context to user request.
|
||||
|
||||
Provides Tatlock with temporal awareness for time-sensitive queries.
|
||||
|
||||
Args:
|
||||
request: Original user request
|
||||
|
||||
Returns:
|
||||
Request with appended time context
|
||||
"""
|
||||
now = datetime.now()
|
||||
time_str = now.strftime("%Y-%m-%d %H:%M")
|
||||
return f"{request}\n\n[Current time: {time_str}]"
|
||||
|
||||
|
||||
@dataclass
|
||||
class EnrichedRequest:
|
||||
"""
|
||||
@@ -65,6 +83,9 @@ async def preprocess_request(
|
||||
>>> print(len(enriched.scoped_tools))
|
||||
5 # All tatlock_core tools
|
||||
"""
|
||||
# Inject temporal context for time-aware processing
|
||||
enriched_request = _inject_temporal_context(user_request)
|
||||
|
||||
logger.info(
|
||||
"preprocessing_request",
|
||||
request_preview=user_request[:100],
|
||||
@@ -74,7 +95,7 @@ async def preprocess_request(
|
||||
|
||||
# Call Steward with full conversation history
|
||||
recommendation = await analyze_request(
|
||||
user_request,
|
||||
enriched_request,
|
||||
conversation_history=conversation_history,
|
||||
conversation_id=conversation_id,
|
||||
)
|
||||
@@ -97,7 +118,7 @@ async def preprocess_request(
|
||||
)
|
||||
|
||||
return EnrichedRequest(
|
||||
original_request=user_request,
|
||||
original_request=enriched_request,
|
||||
steward_note=steward_note,
|
||||
scoped_tools=scoped_tools,
|
||||
recommendation=recommendation,
|
||||
|
||||
Reference in New Issue
Block a user