Skip to content

feat(terminal): add [REMOTE] tag to dispatch log lines#308

Merged
deanq merged 4 commits into
mainfrom
deanq/ae-2646-execution-location-tags
Apr 15, 2026
Merged

feat(terminal): add [REMOTE] tag to dispatch log lines#308
deanq merged 4 commits into
mainfrom
deanq/ae-2646-execution-location-tags

Conversation

@deanq
Copy link
Copy Markdown
Member

@deanq deanq commented Apr 10, 2026

Summary

  • Adds [REMOTE] prefix to log lines emitted at the moment of remote dispatch so users know their code executes on Runpod cloud infrastructure
  • Tags QB dispatch line in ServerlessResource.run(), LB stub dispatch/completion lines in LoadBalancerSlsStub._execute_via_user_route(), and dev server LB proxy dispatch/completion lines in lb_execute()
  • Addresses repeated usability test finding that users don't realize Flash runs their functions remotely

Closes AE-2646

Example output after change

QB execution:

[REMOTE] LiveServerless:unkkp3jdfk406c | API /run
LiveServerless:unkkp3jdfk406c | Started Job:b7475d47-...
Job:b7475d47-... | Status: IN_QUEUE
Job:b7475d47-... | Request assigned to worker 45sgtts0agtx6e, streaming pod logs
...
Job:b7475d47-... | Status: COMPLETED

LB execution:

[REMOTE] GPU Worker | POST /api/process
[REMOTE] GPU Worker | Execution complete

Test plan

  • New test test_run_logs_remote_prefix_on_dispatch verifies QB path emits [REMOTE] tag
  • Updated test_load_balancer_sls_stub.py assertions verify LB stub emits [REMOTE] tag on dispatch and completion
  • Updated test_run_server_helpers.py assertions verify dev server proxy emits [REMOTE] tag on dispatch and completion
  • All 2524 tests pass, 85%+ coverage

@deanq deanq changed the title feat(AE-2646): add [REMOTE] tag to dispatch log lines feat(terminal): add [REMOTE] tag to dispatch log lines Apr 10, 2026
@deanq deanq requested a review from Copilot April 10, 2026 21:09
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/runpod_flash/core/resources/serverless.py
Comment thread tests/unit/resources/test_serverless.py
Copy link
Copy Markdown
Contributor

@runpod-Henrik runpod-Henrik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_dispatch mocks asyncio.sleep but the run() method uses asyncio.to_thread for job polling and does not call sleep directly — the patch("asyncio.sleep") does nothing and may mask a test setup error.
  • The PR body example shows [REMOTE] GPU Worker | POST /api/process but the actual log format in load_balancer_sls.py would 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

deanq added 3 commits April 14, 2026 10:04
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.
@deanq deanq force-pushed the deanq/ae-2646-execution-location-tags branch from 7038056 to 7fe789a Compare April 14, 2026 21:01
- Add [REMOTE] prefix to runsync _fetch_job log line for consistency
  with run() dispatch log
- Add test_runsync_logs_remote_prefix_on_dispatch test
@deanq deanq merged commit 2b4e4c1 into main Apr 15, 2026
4 checks passed
@deanq deanq deleted the deanq/ae-2646-execution-location-tags branch April 15, 2026 04:27
@promptless
Copy link
Copy Markdown

promptless Bot commented Apr 15, 2026

Promptless prepared a documentation update related to this change.

Triggered by PR #308

Documents the [REMOTE] tag that now appears in log output when code dispatches to RunPod cloud infrastructure, helping users understand when their functions execute remotely.

Review: Document [REMOTE] tag in Flash log output

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants