Skip to content

Commit 1f6e2fb

Browse files
authored
feat(core): StreamingChatAdapter for token-by-token Anthropic relay (#503)
## Summary - `StreamingChatAdapter` in `codeframe/core/adapters/streaming_chat.py` wraps `anthropic.AsyncAnthropic().messages.stream()` and yields typed `ChatEvent` objects - Replaces the echo stub in `session_chat_ws.py` (`_run_streaming_adapter`) with the real adapter - Safe read-only tool set for interactive sessions: `read_file`, `list_files`, `search_codebase` - History load/persist via `InteractiveSessionRepository`; tiktoken-based context truncation - 18 unit tests; all 8 acceptance criteria from #503 verified Closes #503
1 parent 8eefe6f commit 1f6e2fb

5 files changed

Lines changed: 1109 additions & 21 deletions

File tree

codeframe/core/adapters/__init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
from codeframe.core.adapters.streaming_chat import (
2+
ChatEvent,
3+
ChatEventType,
4+
StreamingChatAdapter,
5+
STREAMING_SAFE_TOOLS,
6+
)
17
from codeframe.core.adapters.agent_adapter import (
28
AdapterTokenUsage,
39
AgentAdapter,
@@ -17,6 +23,10 @@
1723
from codeframe.core.adapters.verification_wrapper import VerificationWrapper
1824

1925
__all__ = [
26+
"ChatEvent",
27+
"ChatEventType",
28+
"StreamingChatAdapter",
29+
"STREAMING_SAFE_TOOLS",
2030
"AdapterTokenUsage",
2131
"AgentAdapter",
2232
"AgentContext",

0 commit comments

Comments
 (0)