Skip to content

fix: remote mobilenext.ai device allocation response change - #309

Merged
gmegidish merged 4 commits into
mainfrom
fix-remote-mobilenext-allocation
Jul 29, 2026
Merged

fix: remote mobilenext.ai device allocation response change#309
gmegidish merged 4 commits into
mainfrom
fix-remote-mobilenext-allocation

Conversation

@gmegidish

@gmegidish gmegidish commented Jul 28, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • New Features

    • Allocation waits now provide consistent status updates and completion responses.
    • Remote device lookups now use allocation IDs, improving allocation-to-device tracking.
    • Device listings and allocation responses now return more consistent structured data.
  • Bug Fixes

    • Improved handling of allocation timeouts, lookup failures, and unexpected responses.
    • Updated device authentication to use remote access credentials.
    • Corrected CLI help text for remote allocation options.

@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: eba83a3a-bbff-4826-a34c-47ce6abdaab4

📥 Commits

Reviewing files that changed from the base of the PR and between 453ab3f and 8c40a73.

📒 Files selected for processing (5)
  • cli/devices.go
  • cli/flags.go
  • cli/fleet.go
  • cli/remote.go
  • commands/remote.go
 ___________________________________________________________________
< Your PR title says 'refactor'. My diff viewer says 'crime scene'. >
 -------------------------------------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
📝 Walkthrough

Walkthrough

Fleet allocation responses and RPC parameters were converted to typed structures. Remote device retrieval now uses allocation-based lookup, and device providers serialize allocationId instead of sessionId. The fleet and remote allocation commands share a waitForAllocation helper that polls device status until allocation completes or an error occurs. Tests were added for allocation-based device matching.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive No meaningful pull request description was provided, so its relevance to the changeset can't be assessed. Add a brief description summarizing the allocation response and remote lookup changes.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly reflects the main change: remote mobilenext device allocation response handling.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-remote-mobilenext-allocation

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@cli/remote.go`:
- Around line 94-96: Update waitForAllocation so the immediate non-allocating
path populates result.Device before returning. Retrieve the device details using
the existing allocation response identifiers and preserve the current
wait/polling behavior for responses that are still allocating.

In `@commands/remote.go`:
- Around line 76-91: Update FetchRemoteDevices to determine whether the provider
field is absent from the raw device payload, rather than relying on
ProviderType() being empty. Only call SetProvider("mobilenext") when no provider
object exists; preserve an existing provider object and its AllocationID even
when its type is missing.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: eb4da2fe-eb5d-4f4d-ba6f-63512554b3f7

📥 Commits

Reviewing files that changed from the base of the PR and between dbb1e9c and 453ab3f.

📒 Files selected for processing (5)
  • cli/fleet.go
  • cli/remote.go
  • commands/remote.go
  • commands/remote_test.go
  • devices/common.go

Comment thread cli/remote.go
Comment thread commands/remote.go

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@cli/devices.go`:
- Line 26: Update the token acquisition in the devices command around
getRemoteToken so its error is not discarded. Propagate unexpected acquisition
failures to the caller, while explicitly handling only the intended
unauthenticated local-only case; do not invoke commands.DevicesCommand with an
empty token when keyring or other errors occur.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: eba83a3a-bbff-4826-a34c-47ce6abdaab4

📥 Commits

Reviewing files that changed from the base of the PR and between 453ab3f and 8c40a73.

📒 Files selected for processing (5)
  • cli/devices.go
  • cli/flags.go
  • cli/fleet.go
  • cli/remote.go
  • commands/remote.go
💤 Files with no reviewable changes (1)
  • cli/fleet.go
🚧 Files skipped from review as they are similar to previous changes (2)
  • cli/remote.go
  • commands/remote.go

Comment thread cli/devices.go
}

token, _ := getFleetToken()
token, _ := getRemoteToken()

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Do not discard remote-token acquisition errors.

Line 26 ignores errors from getRemoteToken(). Passing an empty token makes commands.DevicesCommand skip remote fetching and return success, silently omitting remote devices—even for keyring or other unexpected failures. Propagate the error, or explicitly handle only the intended unauthenticated local-only case.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@cli/devices.go` at line 26, Update the token acquisition in the devices
command around getRemoteToken so its error is not discarded. Propagate
unexpected acquisition failures to the caller, while explicitly handling only
the intended unauthenticated local-only case; do not invoke
commands.DevicesCommand with an empty token when keyring or other errors occur.

@gmegidish
gmegidish merged commit cf5d144 into main Jul 29, 2026
19 checks passed
@gmegidish
gmegidish deleted the fix-remote-mobilenext-allocation branch July 29, 2026 06:13
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.

1 participant