Skip to content

fix(read): avoid search focus for chat_id opens#15

Merged
channprj merged 1 commit into
channprj:mainfrom
MadKangYu:codex/chat-id-direct-open
Jun 5, 2026
Merged

fix(read): avoid search focus for chat_id opens#15
channprj merged 1 commit into
channprj:mainfrom
MadKangYu:codex/chat-id-direct-open

Conversation

@MadKangYu

Copy link
Copy Markdown
Contributor

Summary

  • add kmsg read --chat-id <chat-id> support using the existing chat registry
  • resolve chat IDs by activating the visible chat-list row before falling back to search
  • reuse the chat-id resolver from send and track chat-list-opened windows as transient windows for cleanup

Verification

  • swift build
  • .build/debug/kmsg read --help
  • git diff --check

Gaps

  • swift test reports no Swift tests are defined.
  • python3 -m pytest tests could not run because pytest is not installed in the local Python environment.
  • Live read --chat-id smoke did not complete locally because the debug binary hung before returning output during auth/window bootstrap, so this PR is build/help verified rather than live-transcript verified.

@MadKangYu MadKangYu force-pushed the codex/chat-id-direct-open branch 3 times, most recently from fcca4cf to 9114520 Compare May 27, 2026 05:37
chat_id lookups already come from the chat list registry, so prefer the visible chat-list row before falling back to KakaoTalk global search. Normalize KakaoTalk windows to a readable minimum size before scanning/opening so chat_id reads do not depend on a tiny or unrelated focused search window, while preserving existing larger windows and restoring the previous window position after automatic resizing.

Add an opt-in read --layout mode for operator-controlled placement. The default preserve mode keeps the current location, while left/right layout uses AX frame control against the current display bounds instead of Mission Control or Split View automation.

Expose the same read controls through kmsg_read so Hermes MCP agents can use stable chat_id reads and inherit KMSG_DEFAULT_READ_LAYOUT for operator-safe placement.

Constraint: KakaoTalk search fields can remain focused in unrelated small windows and fail AX focus verification.

Constraint: Automatic resizing must avoid shrinking user-sized windows or moving them to a surprising screen position unless the operator explicitly asks for layout.

Constraint: Hermes uses the kmsg MCP server, so CLI-only read options are not enough for agent runs.

Rejected: Only document FOCUS_FAIL recovery | leaves chat_id reads dependent on the same failing search path.

Rejected: Always use global search for chat_id | wastes the stronger identity from the chat list registry and keeps the focus failure mode.

Rejected: Drive Mission Control or Split View | too disruptive and not exposed as a stable public automation surface.

Rejected: Clamp every chat window to a fixed maximum by default | would shrink user-sized windows and create avoidable disruption.

Confidence: medium

Scope-risk: moderate

Tested: swift build; swift build -c release; .build/release/kmsg --version; .build/release/kmsg read --help; git diff --check

Not-tested: live read --chat-id completion; local debug binary previously hung in auth/window bootstrap before returning output. swift test unavailable because the package has no Tests target. Python tests unavailable because pytest is not installed.
@MadKangYu MadKangYu force-pushed the codex/chat-id-direct-open branch from 9114520 to 30e7298 Compare May 27, 2026 05:43
@channprj

channprj commented Jun 5, 2026

Copy link
Copy Markdown
Owner

I plan to refactor the whole codebase and resolve major feature issues. I will proceed with debugging and testing right after. Thanks for your contribution! 👍🏻

@channprj channprj merged commit 6e0a04b into channprj:main Jun 5, 2026
1 check 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