Skip to content

Commit 6c997d2

Browse files
committed
Refactor deep research execution: remove streaming support, clean up related code, and update tests for synchronous processing.
1 parent 67f3563 commit 6c997d2

File tree

11 files changed

+69
-733
lines changed

11 files changed

+69
-733
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ Options:
4646
- `--output PATH` — where to write the XML file (defaults to `<slug>_<timestamp>.xml`).
4747
- `--no-background` — force synchronous execution (useful for short or restricted queries).
4848
- `--max-tool-calls N` — cap the total number of tool calls for cost control.
49-
- `--no-stream-progress` — fall back to batched responses instead of streaming events.
5049
- `--export-format FORMAT` — repeat to emit Markdown (`md`), HTML (`html`), or PDF (`pdf`) alongside the base XML output.
5150

5251
Example output file name: `lithium-ion-battery-recycling_20250107_143233.xml`.

src/compendiumscribe/cli.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,6 @@ def _default_output_path(topic: str) -> Path:
3939
is_flag=True,
4040
help="Run deep research synchronously instead of background mode.",
4141
)
42-
@click.option(
43-
"--no-stream-progress",
44-
is_flag=True,
45-
help="Disable streaming updates from the deep research run.",
46-
)
4742
@click.option(
4843
"--export-format",
4944
"export_formats",
@@ -63,7 +58,6 @@ def main(
6358
topic: str,
6459
output_path: Path | None,
6560
no_background: bool,
66-
no_stream_progress: bool,
6761
export_formats: tuple[str, ...],
6862
max_tool_calls: int | None,
6963
):
@@ -86,7 +80,6 @@ def handle_progress(update: ResearchProgress) -> None:
8680

8781
config = ResearchConfig(
8882
background=not no_background,
89-
stream_progress=not no_stream_progress,
9083
max_tool_calls=max_tool_calls,
9184
progress_callback=handle_progress,
9285
)

src/compendiumscribe/research/__init__.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,8 @@
33
from .config import ResearchConfig
44
from .errors import DeepResearchError
55
from .execution import (
6-
accumulate_stream_tool_event,
76
await_completion,
8-
collect_stream_fragments,
9-
emit_trace_updates_from_item,
107
execute_deep_research,
11-
execute_deep_research_streaming,
12-
extract_stream_error_message,
13-
extract_stream_tool_fragment,
14-
handle_stream_event,
15-
merge_action_payload,
16-
merge_response_payload,
17-
merge_tool_fragment,
188
)
199
from .orchestrator import build_compendium
2010
from .parsing import (
@@ -73,17 +63,7 @@
7363
"extract_trace_events",
7464
"parse_deep_research_response",
7565
"execute_deep_research",
76-
"execute_deep_research_streaming",
7766
"await_completion",
78-
"handle_stream_event",
79-
"emit_trace_updates_from_item",
80-
"accumulate_stream_tool_event",
81-
"collect_stream_fragments",
82-
"extract_stream_tool_fragment",
83-
"merge_tool_fragment",
84-
"merge_action_payload",
85-
"merge_response_payload",
86-
"extract_stream_error_message",
8767
"summaries_from_trace_events",
8868
"summarize_trace_event",
8969
"trace_event_from_item",

src/compendiumscribe/research/config.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ class ResearchConfig:
2020
prompt_refiner_model: str = "gpt-4.1"
2121
use_prompt_refinement: bool = True
2222
background: bool = True
23-
stream_progress: bool = True
2423
poll_interval_seconds: float = 5.0
2524
max_poll_attempts: int = 240
2625
enable_code_interpreter: bool = True

src/compendiumscribe/research/execution/__init__.py

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,9 @@
22

33
from .core import execute_deep_research
44
from .polling import await_completion
5-
from .stream_events import (
6-
accumulate_stream_tool_event,
7-
collect_stream_fragments,
8-
emit_trace_updates_from_item,
9-
extract_stream_error_message,
10-
extract_stream_tool_fragment,
11-
merge_action_payload,
12-
merge_response_payload,
13-
merge_tool_fragment,
14-
)
15-
from .streaming import execute_deep_research_streaming, handle_stream_event
165

176

187
__all__ = [
19-
"accumulate_stream_tool_event",
208
"await_completion",
21-
"collect_stream_fragments",
22-
"emit_trace_updates_from_item",
239
"execute_deep_research",
24-
"execute_deep_research_streaming",
25-
"extract_stream_error_message",
26-
"extract_stream_tool_fragment",
27-
"handle_stream_event",
28-
"merge_action_payload",
29-
"merge_response_payload",
30-
"merge_tool_fragment",
3110
]

src/compendiumscribe/research/execution/core.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
from ..progress import emit_progress
88
from ..utils import coerce_optional_string, get_field
99
from .polling import await_completion
10-
from .streaming import execute_deep_research_streaming
1110

1211

1312
__all__ = ["execute_deep_research"]
@@ -49,13 +48,6 @@ def execute_deep_research(
4948
message="Submitting deep research request to OpenAI.",
5049
)
5150

52-
if config.stream_progress:
53-
return execute_deep_research_streaming(
54-
client,
55-
request_payload,
56-
config,
57-
)
58-
5951
response = client.responses.create(**request_payload)
6052

6153
status = (

0 commit comments

Comments
 (0)