Feature/kaifeng.yan/fix opencode version - #85
Closed
Million-mo wants to merge 47 commits into
Closed
Conversation
…ration for v1.4.4+ SSE protocol
…add protocol tests
…exhaustiveness warning - Add global_router to conftest.py app fixture for SSE integration testing - Remove unused MemoryStorageProvider import from conftest.py - Add logger.warning for unhandled event types in _extract_session_id wildcard case
…ption isolation - Add SSEStream class and global_event_stream fixture to conftest.py - Add parse_sse_event helper for SSE data line parsing - Add exception isolation to broadcast_event: iterate copy, put_nowait, catch QueueFull - Safe queue removal in _event_generator finally block with contextlib.suppress - Add race condition analysis comment for on_first_subscriber callback
…iff.patch, workspace routing, session_id extraction - Migrate top-level variant into model.variant for UserMessage/MessageRequest (backward-compat) - Replace FileDiff.before/after with FileDiff.patch matching OpenCode v1.4.0+ schema - Add WorkspaceInfo/WorkspaceConnectionStatus models and /experimental/workspace endpoints - Add workspace field to GlobalEvent envelope for TUI routing - Fix base_path to anchor on server working_dir, not agent env.cwd - Extend _extract_session_id for 6 additional event types (22 total) - Add /global/diagnostic and /global/routing-check endpoints - Add DiagnosticResponse model - Update tests for new models and routing behavior
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Keep OpenCode question prompts on the que_* namespace while preserving the legacy permission bridge through /question. The regression tests cover both the new question prefix and the fallback permission reply path. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Keep /global/event fully envelope-shaped so 1.4.4+ clients keep consuming after idle timeouts. Normalizing the routing directory in ServerState keeps the envelope aligned with the TUI filter. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Refresh the compliance suite for wrapped heartbeat events and normalized routing metadata. This keeps the regression coverage aligned with the updated /global/event contract. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
…wrap() Add explicit no-session case block in _extract_session_id for all 16 event types that have no session association (ServerHeartbeatEvent, ServerConnectedEvent, FileWatcherUpdatedEvent, FileEditedEvent, etc.), eliminating spurious logger.warning spam on every broadcast. Replace redundant json.loads(_serialize_event()) in GlobalEventFactory.wrap() with direct model_dump() for better performance. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Expand _extract_session_id tests: verify all 16 no-session events return None without warnings, add test for unknown event types still triggering the case _ warning fallback, update docstrings to reflect GlobalEventFactory.wrap() using model_dump directly. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
…ribute access Add public has_pending_permission() method to OpenCodeInputProvider and use it in permission_routes.py instead of directly accessing _pending_permissions. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
…t race Refactor _serialize_event into _event_to_dict (dict) + _serialize_event (string wrapper) so GlobalEventFactory.wrap() and _event_generator avoid redundant serialization round-trips. Add docstring comments in session_routes.py noting the shared-agent singleton race condition for multi-session scenarios. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
…torage Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
- Add RunSnapshot dataclass to capture per-run state (session_id, input_provider, conversation, model_name, mode_name, parent_session_id) - Add agent_lock to ServerState for short critical section around session binding and snapshot capture only - Add per-session MessageHistory instances (session_conversations) for conversation isolation between concurrent runs - Narrow lock scope in message_routes: hold agent_lock only during bind/snapshot, then release before run_stream() - Thread RunSnapshot through base_agent.run_stream() → _run_stream_once() → _stream_events(); agents use snapshot.session_id instead of live self.session_id for event emission - Refactor interrupt() to accept session_id for targeted per-session cancellation instead of global _cancelled flag - Add cancel_session_run() to ServerState for session-scoped task cancel - Update abort_session to use cancel_session_run + interrupt(session_id=) - Add QA tests: two-sessions-back-to-back, in-flight snapshot isolation
Apply snapshot pattern from Task 1 to session route flows: - _execute_slashed_command: capture snapshot under agent_lock, pass to run_stream - _execute_skill_command: move load_session + snapshot inside agent_lock - init_session: capture snapshot for background agent.run() - summarize_session: capture snapshot, use snapshot.conversation for compaction - get_or_load_session: wrap agent binding in agent_lock (fast path stays lockless) - Add test_read_only_route_during_active_turn QA test
3 tasks
Owner
Author
|
Owner
Author
|
Owner
Author
|
Owner
Author
|
Owner
Author
|
Owner
Author
|
Owner
Author
|
Owner
Author
|
Owner
Author
|
Owner
Author
|
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.
修复opencode更新导致的通信问题