feat(python): implemented host tool event normalization and error checks
- Added `_normalize_host_tool_event` to `RpcClient` to remap transport tool events to executed host tools. - Updated worker tool-end handling to verify `is_error` is false before marking terminal actions complete. - Added test coverage in `test_client.py` and `test_worker.py` for host tool event normalization and errored review submission behavior.
This commit is contained in:
@@ -265,7 +265,13 @@ class GitHubClient:
|
||||
last_exc = exc
|
||||
log.warning(
|
||||
"transient github 5xx, retrying",
|
||||
extra={"method": method, "path": path, "attempt": attempt + 1, "delay": delay, "status": exc.status},
|
||||
extra={
|
||||
"method": method,
|
||||
"path": path,
|
||||
"attempt": attempt + 1,
|
||||
"delay": delay,
|
||||
"status": exc.status,
|
||||
},
|
||||
)
|
||||
time.sleep(delay)
|
||||
raise last_exc # type: ignore[misc]
|
||||
@@ -294,7 +300,13 @@ class GitHubClient:
|
||||
last_exc = exc
|
||||
log.warning(
|
||||
"transient github 5xx, retrying",
|
||||
extra={"method": method, "path": path, "attempt": attempt + 1, "delay": delay, "status": exc.status},
|
||||
extra={
|
||||
"method": method,
|
||||
"path": path,
|
||||
"attempt": attempt + 1,
|
||||
"delay": delay,
|
||||
"status": exc.status,
|
||||
},
|
||||
)
|
||||
await asyncio.sleep(delay)
|
||||
raise last_exc # type: ignore[misc]
|
||||
|
||||
Reference in New Issue
Block a user