feat(terminal): add [REMOTE] tag to dispatch log lines#308
Conversation
There was a problem hiding this comment.
Pull request overview
Adds an explicit [REMOTE] prefix to key INFO log lines emitted when work is dispatched to remote RunPod infrastructure, so terminal output makes it clear that execution is happening off-machine.
Changes:
- Prefix QB dispatch log line in
ServerlessResource.run()with[REMOTE]. - Prefix LB stub dispatch/completion logs and dev-server LB proxy dispatch/completion logs with
[REMOTE]. - Update and add unit tests to assert the new
[REMOTE]-tagged log output.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/runpod_flash/core/resources/serverless.py |
Adds [REMOTE] prefix to the QB /run dispatch log line. |
src/runpod_flash/stubs/load_balancer_sls.py |
Adds [REMOTE] prefix to LB user-route dispatch and completion INFO logs. |
src/runpod_flash/cli/commands/_run_server_helpers.py |
Adds [REMOTE] prefix to dev server LB proxy dispatch and completion INFO logs. |
tests/unit/resources/test_serverless.py |
Adds a new test asserting [REMOTE] is present on the QB dispatch log line. |
tests/unit/test_load_balancer_sls_stub.py |
Updates assertions to require [REMOTE] on LB stub dispatch/completion logs. |
tests/unit/cli/commands/test_run_server_helpers.py |
Updates assertions to require [REMOTE] on dev-server proxy dispatch/completion logs. |
docs/plans/2026-03-05-env-separation-plan.md |
Deletes an env-separation implementation plan doc (scope unrelated to remote logging). |
docs/plans/2026-03-05-env-separation-design.md |
Deletes an env-separation design doc (scope unrelated to remote logging). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Key findings: runsync dispatch path is missing the [REMOTE] tag; uv.lock carries an unreviewed runpod-python dependency bump.
1. Missing [REMOTE] tag on runsync dispatch (Issue — high confidence)
User scenario: A user's QB function is invoked synchronously — either via cross-endpoint routing (a production QB worker calling another QB endpoint through production_wrapper.py) or via ServerlessEndpointStub.execute(sync=True). They see logs like:
LiveServerless:abc123 | API /runsync
but not:
[REMOTE] LiveServerless:abc123 | API /runsync
The PR tags run() at serverless.py:1297 but leaves runsync() at serverless.py:1267 untagged. Both methods dispatch to the RunPod cloud. The runsync path is exercised by production_wrapper.py (cross-endpoint QB→QB routing) and by ServerlessEndpointStub with sync=True.
The PR description's test plan and example output only show /run. There is no test covering the runsync dispatch log line.
Fix: Add [REMOTE] prefix to the log.info inside runsync._fetch_job() and add a corresponding test.
2. uv.lock carries an unreviewed runpod-python bump (Question — medium confidence)
The lock file bumps runpod-python and adds psutil 7.2.2 as a new transitive dependency. Neither pyproject.toml nor the PR description mention this change.
Risk: runpod-python is pinned to git main. A silent SHA advance could introduce behavioral changes to endpoint dispatch, job polling, or serialization. psutil being added without a declared dependency is also surprising — it may indicate a dependency resolution change rather than a deliberate addition.
Question: Was this bump intentional? If so, it needs explicit review of what changed in runpod-python between the two SHAs.
3. Deleted doc files are unrelated to this PR (Nit)
docs/plans/2026-03-05-env-separation-design.md and docs/plans/2026-03-05-env-separation-plan.md are deleted here. Their deletion is orthogonal to the [REMOTE] tag feature. If they're being cleaned up, a separate commit or PR would make the history easier to bisect.
Nits
- The new test
test_run_logs_remote_prefix_on_dispatchmocksasyncio.sleepbut therun()method usesasyncio.to_threadfor job polling and does not callsleepdirectly — thepatch("asyncio.sleep")does nothing and may mask a test setup error. - The PR body example shows
[REMOTE] GPU Worker | POST /api/processbut the actual log format inload_balancer_sls.pywould be[REMOTE] <server repr> | POST /api/process— the example is illustrative enough, but worth keeping aligned with real output if these docs get shared externally.
Verdict
NEEDS WORK — runsync is a live dispatch path with no [REMOTE] tag, creating an inconsistent user experience for synchronous QB execution. The unreviewed runpod-python bump is a secondary concern that needs explicit acknowledgment.
🤖 Reviewed by Henrik's AI-Powered Bug Finder
ServerlessResource.run() now prefixes its dispatch log line with [REMOTE] so users can clearly identify that execution is happening on Runpod cloud infrastructure, not locally.
7038056 to
7fe789a
Compare
- Add [REMOTE] prefix to runsync _fetch_job log line for consistency with run() dispatch log - Add test_runsync_logs_remote_prefix_on_dispatch test
|
Promptless prepared a documentation update related to this change. Triggered by PR #308 Documents the |
Summary
[REMOTE]prefix to log lines emitted at the moment of remote dispatch so users know their code executes on Runpod cloud infrastructureServerlessResource.run(), LB stub dispatch/completion lines inLoadBalancerSlsStub._execute_via_user_route(), and dev server LB proxy dispatch/completion lines inlb_execute()Closes AE-2646
Example output after change
QB execution:
LB execution:
Test plan
test_run_logs_remote_prefix_on_dispatchverifies QB path emits[REMOTE]tagtest_load_balancer_sls_stub.pyassertions verify LB stub emits[REMOTE]tag on dispatch and completiontest_run_server_helpers.pyassertions verify dev server proxy emits[REMOTE]tag on dispatch and completion