baserun-cli 0.1.1__tar.gz → 0.1.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {baserun_cli-0.1.1 → baserun_cli-0.1.3}/PKG-INFO +1 -1
- {baserun_cli-0.1.1 → baserun_cli-0.1.3}/baserun_cli/_vendored/cli.py +27 -2
- {baserun_cli-0.1.1 → baserun_cli-0.1.3}/baserun_cli/channel.py +6 -2
- {baserun_cli-0.1.1 → baserun_cli-0.1.3}/baserun_cli.egg-info/PKG-INFO +1 -1
- {baserun_cli-0.1.1 → baserun_cli-0.1.3}/pyproject.toml +1 -1
- {baserun_cli-0.1.1 → baserun_cli-0.1.3}/README.md +0 -0
- {baserun_cli-0.1.1 → baserun_cli-0.1.3}/baserun_cli/__init__.py +0 -0
- {baserun_cli-0.1.1 → baserun_cli-0.1.3}/baserun_cli/_vendored/__init__.py +0 -0
- {baserun_cli-0.1.1 → baserun_cli-0.1.3}/baserun_cli/_vendored/base.py +0 -0
- {baserun_cli-0.1.1 → baserun_cli-0.1.3}/baserun_cli/_vendored/parsers/__init__.py +0 -0
- {baserun_cli-0.1.1 → baserun_cli-0.1.3}/baserun_cli/_vendored/parsers/base.py +0 -0
- {baserun_cli-0.1.1 → baserun_cli-0.1.3}/baserun_cli/_vendored/parsers/bash_agent.py +0 -0
- {baserun_cli-0.1.1 → baserun_cli-0.1.3}/baserun_cli/_vendored/parsers/claude.py +0 -0
- {baserun_cli-0.1.1 → baserun_cli-0.1.3}/baserun_cli/_vendored/parsers/codex.py +0 -0
- {baserun_cli-0.1.1 → baserun_cli-0.1.3}/baserun_cli/main.py +0 -0
- {baserun_cli-0.1.1 → baserun_cli-0.1.3}/baserun_cli/runner.py +0 -0
- {baserun_cli-0.1.1 → baserun_cli-0.1.3}/baserun_cli.egg-info/SOURCES.txt +0 -0
- {baserun_cli-0.1.1 → baserun_cli-0.1.3}/baserun_cli.egg-info/dependency_links.txt +0 -0
- {baserun_cli-0.1.1 → baserun_cli-0.1.3}/baserun_cli.egg-info/entry_points.txt +0 -0
- {baserun_cli-0.1.1 → baserun_cli-0.1.3}/baserun_cli.egg-info/requires.txt +0 -0
- {baserun_cli-0.1.1 → baserun_cli-0.1.3}/baserun_cli.egg-info/top_level.txt +0 -0
- {baserun_cli-0.1.1 → baserun_cli-0.1.3}/setup.cfg +0 -0
|
@@ -24,6 +24,28 @@ from .base import (
|
|
|
24
24
|
from .parsers import extract_session_id, parse_line
|
|
25
25
|
|
|
26
26
|
|
|
27
|
+
_SUBPROCESS_STREAM_LIMIT = 64 * 1024 * 1024
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
async def _iter_lines(reader: asyncio.StreamReader) -> AsyncIterator[bytes]:
|
|
31
|
+
"""Yield newline-delimited output without StreamReader.readline limits."""
|
|
32
|
+
buf = bytearray()
|
|
33
|
+
while True:
|
|
34
|
+
chunk = await reader.read(64 * 1024)
|
|
35
|
+
if not chunk:
|
|
36
|
+
if buf:
|
|
37
|
+
yield bytes(buf)
|
|
38
|
+
return
|
|
39
|
+
buf.extend(chunk)
|
|
40
|
+
while True:
|
|
41
|
+
pos = buf.find(b"\n")
|
|
42
|
+
if pos < 0:
|
|
43
|
+
break
|
|
44
|
+
line = bytes(buf[:pos])
|
|
45
|
+
del buf[: pos + 1]
|
|
46
|
+
yield line
|
|
47
|
+
|
|
48
|
+
|
|
27
49
|
class CLIAgentConnector(AgentConnector):
|
|
28
50
|
"""The one connector implementation for all spec-compatible CLI agents."""
|
|
29
51
|
|
|
@@ -120,6 +142,7 @@ class CLIAgentConnector(AgentConnector):
|
|
|
120
142
|
stderr=asyncio.subprocess.PIPE,
|
|
121
143
|
env=self._env(),
|
|
122
144
|
cwd=self.spec.workdir,
|
|
145
|
+
limit=_SUBPROCESS_STREAM_LIMIT,
|
|
123
146
|
)
|
|
124
147
|
except FileNotFoundError:
|
|
125
148
|
message = f"CLI not found: {self.spec.bin}. Please install it or configure cli_spec.bin with the correct executable path."
|
|
@@ -152,7 +175,7 @@ class CLIAgentConnector(AgentConnector):
|
|
|
152
175
|
|
|
153
176
|
try:
|
|
154
177
|
assert proc.stdout is not None
|
|
155
|
-
async for raw_line in proc.stdout:
|
|
178
|
+
async for raw_line in _iter_lines(proc.stdout):
|
|
156
179
|
line = raw_line.decode(errors="replace").strip()
|
|
157
180
|
if not line:
|
|
158
181
|
continue
|
|
@@ -279,6 +302,7 @@ class CLIAgentConnector(AgentConnector):
|
|
|
279
302
|
stderr=asyncio.subprocess.PIPE,
|
|
280
303
|
env=self._env(),
|
|
281
304
|
cwd=self.spec.workdir,
|
|
305
|
+
limit=_SUBPROCESS_STREAM_LIMIT,
|
|
282
306
|
)
|
|
283
307
|
try:
|
|
284
308
|
out_b, err_b = await asyncio.wait_for(proc.communicate(), timeout=60.0)
|
|
@@ -320,10 +344,11 @@ class CLIAgentConnector(AgentConnector):
|
|
|
320
344
|
stderr=asyncio.subprocess.PIPE,
|
|
321
345
|
env=self._env(),
|
|
322
346
|
cwd=self.spec.workdir,
|
|
347
|
+
limit=_SUBPROCESS_STREAM_LIMIT,
|
|
323
348
|
)
|
|
324
349
|
try:
|
|
325
350
|
assert proc2.stdout is not None
|
|
326
|
-
async for raw_line in proc2.stdout:
|
|
351
|
+
async for raw_line in _iter_lines(proc2.stdout):
|
|
327
352
|
line = raw_line.decode(errors="replace").strip()
|
|
328
353
|
if not line:
|
|
329
354
|
continue
|
|
@@ -253,9 +253,13 @@ class ChannelClient:
|
|
|
253
253
|
)
|
|
254
254
|
|
|
255
255
|
for ev in missing_events:
|
|
256
|
-
|
|
256
|
+
data = ev.get("data", {})
|
|
257
|
+
if data.get("finished") is True:
|
|
258
|
+
ok = await self.publish_event_reliably(run_id, ev)
|
|
259
|
+
else:
|
|
260
|
+
ok = await self.publish_event(run_id, ev)
|
|
257
261
|
if not ok:
|
|
258
|
-
log.error("verify: replay still failed for run %s seq=%s", run_id,
|
|
262
|
+
log.error("verify: replay still failed for run %s seq=%s", run_id, data.get("seq"))
|
|
259
263
|
|
|
260
264
|
async def run(self) -> None:
|
|
261
265
|
"""Main loop: WS subscriber + HTTP claim-task poller, running in parallel.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|