Add background-safe reads, split layouts, and media metadata#17
Draft
MadKangYu wants to merge 5 commits into
Draft
Add background-safe reads, split layouts, and media metadata#17MadKangYu wants to merge 5 commits into
MadKangYu wants to merge 5 commits into
Conversation
Background-safe reads must fail cleanly instead of activating KakaoTalk, opening rooms, or leaking available chat titles. The read JSON now also carries media/link/attachment metadata so operations can queue image-bearing messages without storing raw image content. Constraint: AX-based Kakao reads can only inspect exposed UI safely without stealing focus Rejected: Frequent idle polling wrapper | still risks user disruption and lives outside the CLI contract Rejected: Raw image capture in read JSON | would expand private data exposure beyond message metadata Confidence: medium Scope-risk: moderate Directive: Do not make background-safe paths call activate, launch, login, search, resize, or close windows without revalidating operator impact Tested: swift build Tested: python3 -m unittest discover -s tests Tested: kmsg read __codex_no_such_chat__ --background-safe exits with BACKGROUND_SAFE_BLOCKED and hides window titles
Marketing operators need to keep KakaoTalk beside browsers and ad tools without the CLI resizing into a large operator-only window. The read command now supports split-left and split-right layouts, MCP accepts the same values, and the entrypoint follows the installed executable name so local operations can install the patched build as kangyu instead of replacing kmsg. Constraint: Local automation should not overwrite the existing kmsg command when the operator asks for a separate kangyu command Rejected: Symlink kangyu to a kmsg-named binary only | help and examples would still instruct users to run kmsg Confidence: high Scope-risk: narrow Directive: Keep background-safe behavior non-mutating; split layouts are for explicit layout requests only Tested: swift build Tested: python3 -m unittest discover -s tests Tested: /Users/yu/.local/bin/kangyu --help shows kangyu and read --layout split-left/split-right Tested: /Users/yu/.local/bin/kangyu read __codex_no_such_chat__ --background-safe --limit 1 --json exits with BACKGROUND_SAFE_BLOCKED
Madstamp runs the patched upstream kmsg build as a separate kangyu executable and a kmsg.kangyu MCP server ID until the upstream PR lands. Documenting the source-of-truth repo URLs prevents operators from replacing the canonical kmsg binary or guessing which fork owns the deployment patch.\n\nConstraint: Upstream official repository remains channprj/kmsg\nConstraint: Local Madstamp Hermes profile should not overwrite /Users/yu/.local/bin/kmsg\nRejected: Rename the upstream project to KangYu | would confuse upstream PR review and public package identity\nConfidence: high\nScope-risk: narrow\nDirective: Keep MCP server ID kmsg.kangyu for Madstamp profile while command points to /Users/yu/.local/bin/kangyu\nTested: python3 -m unittest discover -s tests\nTested: hermes --profile madstamp mcp list shows kmsg.kangyu enabled\nNot-tested: Upstream maintainer acceptance of the deployment naming note
The CLI supported --background-safe, but MCP clients could not request it, so Hermes would still have to choose between normal read and split layout behavior. Add a background_safe tool argument, pass it to read, and avoid automatic deep-recovery retry in that mode so a blocked background-safe read remains non-disruptive.\n\nConstraint: Background-safe MCP reads must not fall through into window-opening recovery behavior\nRejected: Rely on split-right default layout only | still permits operator-visible UI movement and misses the user's background-read requirement\nConfidence: high\nScope-risk: narrow\nDirective: Keep background_safe available on kmsg_read whenever --background-safe exists on the CLI\nTested: swift build\nTested: python3 -m unittest discover -s tests\nNot-tested: Live KakaoTalk MCP read of a real exposed chat window
MCP initialize was still running a Kakao status probe during startup, so an AX or app-state stall could block Hermes before tools/list was available. Startup now verifies the executable version and skips status by default, while retaining an opt-in KMSG_MCP_STARTUP_STATUS_CHECK gate for manual diagnostics.\n\nConstraint: MCP clients need initialize/tools-list to return even when KakaoTalk UI readiness is unstable\nRejected: Increase the status timeout | it preserves the blocking failure mode\nConfidence: high\nScope-risk: narrow\nDirective: Do not make MCP initialize depend on foreground KakaoTalk UI state by default\nTested: swift build\nTested: python3 -m unittest discover -s tests\nNot-tested: KMSG_MCP_STARTUP_STATUS_CHECK=true on a healthy live KakaoTalk session
44bafcb to
c43fa11
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
read --background-safeto read only already exposed matching chat windows without launching, activating, logging in, searching, resizing, opening, or closing windowskmsg_read.background_safeKMSG_MCP_STARTUP_STATUS_CHECK=trueis explicitly sethas_image,image_count,link_count,has_attachment, andattachment_countfields in read JSONsplit-leftandsplit-rightread layouts for marketing operators who keep KakaoTalk beside browsers or ad toolskangyuinstead of replacingkmsghttps://github.com/channprj/kmsg; KangYu/Madstamp uses MCP server IDkmsg.kangyuwith command/Users/yu/.local/bin/kangyuuntil this patch lands upstreamDeployment identity
kmsg.kangyu/Users/yu/.local/bin/kangyusplit-rightVerification
swift buildswift build -c releasepython3 -m unittest discover -s tests/Users/yu/.local/bin/kangyu --helpshowskangyuin usage/examples/Users/yu/.local/bin/kangyu read --helplistssplit-leftandsplit-rightlayoutsinitialize+tools/listreturnskmsg_read.background_safe, startupstatus_check=skipped, and Hermes env layout defaultsplit-righthermes --profile madstamp mcp listshowskmsg.kangyuenabled with/Users/yu/.local/bin/kangyuNotes
split-left/split-rightare explicit layout requests.--background-safestill preserves existing window focus, size, and position.