Skip to content

Commit d9199ad

Browse files
usnavy13claude
andcommitted
fix: Resolve 4 CI failures — test mocks, assertions, and bandit suppressions
- Egress proxy tunnel test: use IP literal 127.0.0.1 instead of localhost to avoid IPv6 resolution mismatch in CI - Batch upload mock: add missing is_read_only param to fake_store - Client-replay test: allow inherited file refs in exec response (matches LibreChat CodeExecutor.ts contract) - Bandit B103: suppress intentional 0o1777 chmod on shared skill-deps dir Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent f9ae8bc commit d9199ad

5 files changed

Lines changed: 7 additions & 6 deletions

File tree

src/api/admin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ async def purge_skill_deps(_: str = Depends(verify_master_key)):
302302

303303
# Reset perms so future installs from sandbox uids work.
304304
try:
305-
os.chmod(str(deps_root), 0o1777)
305+
os.chmod(str(deps_root), 0o1777) # nosec B103
306306
except OSError:
307307
pass
308308

src/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ async def _startup_egress_proxy(app: FastAPI) -> None:
160160
# Sticky + world-writable, like /tmp. The sandbox uid (e.g. 1001) needs
161161
# to write here; keeping it sticky means one sandbox can't unlink
162162
# another's files.
163-
os.chmod(str(deps_root), 0o1777)
163+
os.chmod(str(deps_root), 0o1777) # nosec B103
164164
except OSError as exc:
165165
logger.warning(
166166
"Could not prepare skill-deps directory; "

tests/functional/test_client_replay.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@ async def test_uploaded_files_follow_runtime_session_when_first_exec_has_no_outp
140140
injected_files=upload_refs,
141141
)
142142
assert "a,b" in first["stdout"]
143-
assert first["files"] == []
143+
generated = [f for f in first["files"] if not f.get("inherited")]
144+
assert generated == [], f"Expected no generated files, got: {generated}"
144145

145146
second = await _exec_like_runtime(
146147
async_client,

tests/integration/test_librechat_compat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1901,7 +1901,7 @@ def setup_mocks(self):
19011901
stored_filenames = []
19021902

19031903
async def fake_store(
1904-
session_id, filename, content, content_type, is_agent_file
1904+
session_id, filename, content, content_type, is_agent_file, is_read_only=False
19051905
):
19061906
stored_filenames.append(filename)
19071907
return f"fid-{len(stored_filenames)}"

tests/unit/test_egress_proxy.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,11 +211,11 @@ async def echo_handler(reader, writer):
211211
echo_server = await asyncio.start_server(echo_handler, "127.0.0.1", echo_port)
212212

213213
proxy_port = _free_port()
214-
proxy = EgressProxy(port=proxy_port, allowlist={"localhost"})
214+
proxy = EgressProxy(port=proxy_port, allowlist={"127.0.0.1"})
215215
await proxy.start()
216216
try:
217217
status, reader, writer = await _send_connect(
218-
proxy_port, f"localhost:{echo_port}"
218+
proxy_port, f"127.0.0.1:{echo_port}"
219219
)
220220
assert b"200" in status, status
221221

0 commit comments

Comments
 (0)