Skip to content

fix: preserve remote config for interaction commands#616

Merged
thymikee merged 1 commit into
callstack:mainfrom
mikegarfinkle:fix-config-common-options
May 30, 2026
Merged

fix: preserve remote config for interaction commands#616
thymikee merged 1 commit into
callstack:mainfrom
mikegarfinkle:fix-config-common-options

Conversation

@mikegarfinkle
Copy link
Copy Markdown
Contributor

@mikegarfinkle mikegarfinkle commented May 29, 2026

Summary

PR #593 introduced structured command definitions for the CLI/MCP path. Interaction commands (press, click, fill, longpress, get) now parse CLI input into structured input, then convert that back into client options with commonToClientOptions().

That conversion returned remote fields even when they were absent from the command input:

{ daemonBaseUrl: undefined, daemonAuthToken: undefined, tenant: undefined, runId: undefined }

Because per-command options are merged over the configured client defaults, those explicit undefined values erased the remote daemon fields loaded from --config. This showed up in remote-device environments that run through a generated config file. Read-only commands still reached the remote daemon, but interaction commands fell back to local daemon metadata and failed before dispatch:

agent-device --config remote-dev-infra/agent-device.json press @e13
# Error: Daemon HTTP endpoint is unavailable

This PR wraps commonToClientOptions() in compactRecord(). compactRecord() removes entries whose value is undefined, so absent per-command fields are omitted instead of overwriting the configured remote defaults. Regression coverage now checks press, click, fill, longpress, and get with remote config defaults.

Validation

  • Local E2E before/after: started a local HTTP daemon and ran press through --config. The current broken CLI failed with Daemon HTTP endpoint is unavailable; CLI with these changes reached the daemon and failed later with SESSION_NOT_FOUND

@mikegarfinkle mikegarfinkle marked this pull request as ready for review May 29, 2026 22:14
Copilot AI review requested due to automatic review settings May 29, 2026 22:14
Copy link
Copy Markdown
Member

@thymikee thymikee left a comment

Choose a reason for hiding this comment

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

Thanks!

@thymikee thymikee merged commit 10501b0 into callstack:main May 30, 2026
11 checks passed
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.

2 participants