Skip to content

Return the matched result from start_command - #243

Open
masaru87 wants to merge 1 commit into
pf-robotics:mainfrom
masaru87:fix/start-command-matched-result
Open

masaru87 wants to merge 1 commit into
pf-robotics:mainfrom
masaru87:fix/start-command-matched-result

Conversation

@masaru87

Copy link
Copy Markdown

Summary

Return the result that was already matched by command ID in the synchronous and
asynchronous start_command implementations.

Problem

After GetLastCommandResult returns the response whose command ID matches the
command started by this call, the current implementation discards that response
and performs another cursorless lookup. If another command finishes between the
two lookups, start_command can return the newer command's result instead.

Change

Return command_result_response.result directly after the command ID matches.
This also avoids one unnecessary RPC. The synchronous client was regenerated
from the asynchronous source with the repository's generation script.

Verification

A deterministic local stub made command A complete successfully and then made
command B the latest failed result before the second lookup. Before this change,
both the synchronous and asynchronous clients returned command B's result.
After this change, both return command A's matched result (2 tests passed).

@masaru87
masaru87 requested a review from a team as a code owner August 19, 2026 13:54
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