fix(agy-acp): Windows path resolution and sender_context noise stripping#1331
Closed
SunnyYYLin wants to merge 2 commits into
Closed
fix(agy-acp): Windows path resolution and sender_context noise stripping#1331SunnyYYLin wants to merge 2 commits into
SunnyYYLin wants to merge 2 commits into
Conversation
Three fixes for running agy-acp on Windows (or any non-Linux host):
1. HOME -> USERPROFILE fallback
Adapter::new() now tries HOME first, then USERPROFILE (Windows
default), then /tmp. Without this the conversation database lands
under C:\tmp instead of C:\Users\<user>\.gemini.
2. agy_bin() - cross-platform binary resolution
On Windows, Command::new("agy") resolves via the system PATH,
avoiding the hardcoded /usr/local/bin/agy path which does not exist
on Windows.
3. augmented_path() - Windows PATH separator
Uses ; on Windows instead of :, and queries USERPROFILE for
home-relative bin dirs.
4. Strip <sender_context> XML from prompts (Issue openabdev#61)
openab gateway injects <sender_context>...</sender_context> blocks
into every message for multi-user identity tracking. CLI agents
like agy do not understand this format and see it as prompt noise.
prepare_prompt_state() now strips these blocks before forwarding
the prompt to the agy process.
…oritize USERPROFILE on Windows
Contributor
|
Caution This PR is missing a Discord Discussion URL in the body. All PRs must reference a prior Discord discussion to ensure community alignment before implementation. Please edit the PR description to include a link like: |
|
🔒 Auto-closing: this PR has had the If you'd like to continue working on this, please submit a new PR and link to this one if necessary. |
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.
Closes
Closes #1329
At a Glance
Prior Art & Industry Research
Not applicable — this is a straightforward cross-platform compatibility fix for the Windows host environment.
Proposed Solution
HOME/USERPROFILE: On Windows, check
USERPROFILEbeforeHOMEbecause the parent openab process setsHOMEto the workspace directory, overriding the user's actual home. Applied in bothAdapter::new()(conversation DB location) andaugmented_path()(bin dir resolution).agy_bin(): On Windows, use
"agy"(system PATH lookup) instead of hardcoded/usr/local/bin/agy.augmented_path(): Use
;separator on Windows,:on Unix. QueryUSERPROFILEfor home-relative bin dirs on Windows.sender_context stripping: Strip
<sender_context>...</sender_context>XML blocks from prompts before forwarding to agy. CLI agents don't understand this metadata injected by the gateway (Issue tracking: Sender Identity Injection System for Agent Broker #61).Nested protobuf extraction: Handle an additional nesting level in Gemini protobuf payloads where text is under field(20)→field(1)→field(1) instead of just field(20)→field(1).
Why This Approach
cfg!(target_os = "windows")with clear fallbacksUSERPROFILEfirst becauseHOMEis polluted by the gatewayAlternatives Considered
USERPROFILEis the standard Windows convention.Validation