You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
extract_image_refs() only recognized POSIX-style / and ~/ image paths. On native Windows, kanban task-body image enrichment silently skipped drive-letter paths such as C:\Users\Hiro\shot.png. Fixes#61568.
Root cause
agent/image_routing.py claimed to match the gateway extract_local_files() shape, but its local-image regex was never updated after #34632 added Windows drive-letter support to the gateway path. It also deduped before path normalization.
Fix
Extend the local-image regex to accept absolute Windows drive-letter paths with / or \ separators.
Normalize expanded local paths before file checks and dedupe with normcase() so native Windows separator/case normalization is respected.
Set USERPROFILE in the tilde expansion test so the same test matches Python's Windows expanduser() behavior.
Add platform-independent regression tests for Windows drive-letter paths, lowercase drives, relative-drive non-matches, and URL lookbehind behavior.
On current main, _LOCAL_IMAGE_PATH_RE returns no match for C:\Users\Hiro\shot.png, C:/Users/Hiro/shot.png, or c:/shot.PNG. After the fix, all three match and still pass the existing file-existence gate.
Duplicate of #34374 (earliest open PR) — both extend agent/image_routing.py's _LOCAL_IMAGE_PATH_RE with the same [A-Za-z]:[/\\] Windows drive-letter alternation. This PR additionally adds normcase() deduping (a minor extra), but the core fix is the same. Related to the bug spec #61568.
Thanks for the focused Windows fix. The premise is confirmed on current main: agent/image_routing.py:69 accepts only ~/ and /, while the kanban worker calls extract_image_refs() on the task body at cli.py:16073. The proposed drive-letter and mixed-separator pattern matches the established gateway implementation at gateway/platforms/base.py:3730 (commit 51d165a8e).
The PR’s regression cases cover backslash and slash drive paths, lowercase drives, relative-drive rejection, and URL lookbehind. The implementation is narrow and does not alter tool schemas, session state, or prompt caching.
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
comp/agentCore agent runtime: loop, agent_init, prompt builder, context-compression, responses endpointduplicateThis issue or pull request already existsP2Medium — degraded but workaround existsplatform/windowsNative Windows-specific behavior or breakagesweeper:blast-containedSweeper blast radius: contained — one narrow path / opt-in / few userssweeper:risk-platform-windowsSweeper risk: may break or behave differently on native Windowstype/bugSomething isn't working
3 participants
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.
Problem
extract_image_refs()only recognized POSIX-style/and~/image paths. On native Windows, kanban task-body image enrichment silently skipped drive-letter paths such asC:\Users\Hiro\shot.png. Fixes #61568.Root cause
agent/image_routing.pyclaimed to match the gatewayextract_local_files()shape, but its local-image regex was never updated after #34632 added Windows drive-letter support to the gateway path. It also deduped before path normalization.Fix
/or\separators.normcase()so native Windows separator/case normalization is respected.USERPROFILEin the tilde expansion test so the same test matches Python's Windowsexpanduser()behavior.Tests
scripts/run_tests.sh tests/agent/test_image_routing.py -qscripts/run_tests.sh tests/hermes_cli/test_kanban_worker_image_extraction.py -qRepro
On current
main,_LOCAL_IMAGE_PATH_REreturns no match forC:\Users\Hiro\shot.png,C:/Users/Hiro/shot.png, orc:/shot.PNG. After the fix, all three match and still pass the existing file-existence gate.