Skip to content

fix(browser): parse DOMShell structured fields for ls and grep - #379

Open
cat0825 wants to merge 1 commit into
HKUDS:mainfrom
cat0825:fix/issue-342-316
Open

fix(browser): parse DOMShell structured fields for ls and grep#379
cat0825 wants to merge 1 commit into
HKUDS:mainfrom
cat0825:fix/issue-342-316

Conversation

@cat0825

@cat0825 cat0825 commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Description

This PR fixes multiple DOMShell parsing issues introduced in the 2.x migration, addressing both ls and grep formats.

  • Updates _parse_execute_result for ls to extract name, role, and path properly, enabling correct JSON round-tripping for follow-up fs commands.
  • Updates _parse_execute_result for grep to extract structured fields and adds logic in browser_cli.py to neatly display these elements rather than raw string matching.
  • Ensures robust fallback if the format changes upstream.

Fixes #342
Fixes #316

Type of Change

  • New Software CLI (in-repo)
  • New Software CLI (standalone repo)
  • New Feature
  • Bug Fix
  • Documentation
  • Other

For Existing CLI Modifications

  • All unit tests pass: python3 -m pytest cli_anything/<software>/tests/test_core.py -v
  • All E2E tests pass: python3 -m pytest cli_anything/<software>/tests/test_full_e2e.py -v
  • No test regressions — no previously passing tests were removed or weakened
  • registry.json entry is updated if version, description, or requirements changed

General Checklist

  • Code follows existing patterns and conventions
  • --json flag is supported on any new commands
  • Commit messages follow the conventional format (feat:, fix:, docs:, test:)
  • I have tested my changes locally

Test Results

============================= test session starts ==============================
platform darwin -- Python 3.12.2, pytest-7.4.4, pluggy-1.0.0 -- /opt/anaconda3/bin/python
cachedir: .pytest_cache
rootdir: /Users/qianyuhe/研究生生活/CLI-Anything/browser/agent-harness
plugins: anyio-4.14.1
collecting ... 
...
============================= 111 passed in 1.12s ==============================

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

existing-cli-fix Fixes or improves an existing CLI harness

Projects

None yet

1 participant