ci: add pytest CI workflow and fix all test failures - #136
Closed
Million-mo wants to merge 2 commits into
Closed
Conversation
* feat(acp): batch SessionUpdate delivery during replay Refactor ACPNotifications.replay() from sequential per-update session/update notifications to collect-then-batch-send pattern: - Add _collect_request_updates/_collect_response_updates as pure conversion methods returning list[SessionUpdate] (no I/O) - Add send_batch_update() that uses ext_notification _batch_session_updates when client supports it, falls back to sequential session/update otherwise - Add notification_batch_size (default 20) and notification_flush_interval (default 0.0) constructor params to ACPNotifications - Add set_batch_support() for capability-based opt-in - Wire batch support detection into ACPSession.__post_init__ via client_capabilities.field_meta - Keep _replay_request/_replay_response as thin wrappers for backward compatibility - Add 6 new tests covering batch mode, fallback, ordering, custom size, pure collector, and empty messages - Add benchmark script comparing batch vs sequential OpenSpec change: acp-notification-batching Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai> * refactor(acp): address PR #68 review feedback - Remove parameter (YAGNI — no real use case) - Move benchmark script from tests/ to scripts/ to avoid pytest collection - Revert unrelated CI fix from test_from_config_capabilities_not_duplicated - Add defensive debug log when _tool_call_inputs cache misses on ToolReturnPart * fix(test): restore monkeypatch.setenv for OPENAI_API_KEY in test_from_config_capabilities_not_duplicated CI environment has no OPENAI_API_KEY set; the setenv is required for the test that creates a NativeAgentConfig with model=openai:gpt-4o-mini. --------- Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
…sage API (#149) * fix(opencode): update tool input from ToolCallProgressEvent When ToolCallStartEvent arrives before tool arguments are fully streamed, ctx stores an empty dict as tool_input. Subsequent ToolCallProgressEvent carries the complete event_tool_input but _process_tool_progress ignored it, reading the stale empty value from ctx instead. This caused tool call parameters to always appear empty in the session message API. Fix: update ctx with event_tool_input when it differs from the stored value, before constructing the tool state. Closes #148 * fix(opencode): convert event_tool_input to camelCase before comparison Address Gemini review feedback: comparing raw snake_case event_tool_input with camelCase current_input always evaluates to True when keys contain underscores, causing redundant ctx.set_tool_input calls on every progress event. Convert to camelCase first, then compare.
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.
Summary
Adds a dedicated pytest CI workflow and fixes all test failures introduced by PR #65 (pool-less architecture refactor).
Changes
Bug fixes (
a744fca65):asyncio.create_taskmissing()on coroutine calls inacp_agent.pyparent_session_idtoRunStartedEventinrun.pyparent_idfield into_chat_message()insql_provider/utils.pyTest cleanup (
49f81908b):CI workflow (
0526ea508..340e799d5):.github/workflows/pytest.ymlwith 5 segmented stages: smoke, unit, integration, core, reportbuild.ymltoworkflow_dispatchonlyrequires_openai_keymarker — auto-skips 33 credential-dependent tests withoutOPENAI_API_KEYtest_skill_performance.pyasslow(CI runner too slow for timing thresholds)tests/test_processors.pyfor history processor import pathstest_acp_v2_extensions.pysync tests to async (fixasyncio.get_event_loop()deprecation)acp_snapshotfrom CI Core jobtest_collision_warning_loggedto mock structlog logger instead of caplogCI Results
All 5 stages pass ✅:
Test plan