fix(browser): harden bridge and sync REPL template#220
fix(browser): harden bridge and sync REPL template#220yangshu2087 wants to merge 6 commits intoHKUDS:mainfrom
Conversation
|
Fork-side PR CI is now green on the latest push.
Fixes included in the latest commit:
Note: the upstream PR currently shows no native status checks because the CI workflow was added in this branch; it will become available on the base repo after merge. |
|
Overall this PR is not focused and is containing too many things as the author also said. Here are my comments:
|
There was a problem hiding this comment.
Pull request overview
This PR hardens the browser harness’ DOMShell/daemon integration (including session persistence + unified tool-result error detection), and synchronizes the canonical ReplSkin template across harnesses while adding a PR verification workflow.
Changes:
- Add browser tool-result normalization/error heuristics and use them to gate session updates + improve CLI output.
- Persist browser session state to disk when daemon mode is active (and auto-load when a daemon is already running).
- Sync
repl_skin.pyacross many harnesses and add a PR CI workflow that compiles skins + runs browser unit tests.
Reviewed changes
Copilot reviewed 50 out of 50 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| zotero/agent-harness/cli_anything/zotero/utils/repl_skin.py | Sync REPL skin banner/prompt/help/goodbye to the canonical template. |
| zoom/agent-harness/cli_anything/zoom/utils/repl_skin.py | Sync REPL skin template; adjust accent map + init signature. |
| wiremock/agent-harness/cli_anything/wiremock/utils/repl_skin.py | Sync REPL skin template; minor table separator change. |
| videocaptioner/agent-harness/cli_anything/videocaptioner/utils/repl_skin.py | Sync REPL skin template; init signature + accent map changes. |
| slay_the_spire_ii/agent-harness/cli_anything/slay_the_spire_ii/utils/repl_skin.py | Sync REPL skin template (banner/prompt/help/goodbye). |
| shotcut/agent-harness/cli_anything/shotcut/utils/repl_skin.py | Sync REPL skin template; add skill_path auto-detect param. |
| seaclip/agent-harness/cli_anything/seaclip/utils/repl_skin.py | Sync REPL skin template; init signature + accent map changes. |
| rms/agent-harness/cli_anything/rms/utils/repl_skin.py | Sync REPL skin template; remove extra accent entries. |
| renderdoc/agent-harness/cli_anything/renderdoc/utils/repl_skin.py | Sync REPL skin template (banner/prompt/help/goodbye). |
| pm2/agent-harness/cli_anything/pm2/utils/repl_skin.py | Sync REPL skin template; init signature + accent map changes. |
| openscreen/agent-harness/cli_anything/openscreen/utils/repl_skin.py | Sync REPL skin template; removes sub_input (breaking change). |
| ollama/agent-harness/cli_anything/ollama/utils/repl_skin.py | Sync REPL skin template; init signature + accent map changes. |
| obsidian/agent-harness/cli_anything/obsidian/utils/repl_skin.py | Sync REPL skin template; init signature + accent map changes. |
| obs-studio/agent-harness/cli_anything/obs_studio/utils/repl_skin.py | Sync REPL skin template; add skill_path auto-detect param. |
| musescore/agent-harness/cli_anything/musescore/utils/repl_skin.py | Sync REPL skin template; add skill_path auto-detect param. |
| mubu/agent-harness/cli_anything/mubu/utils/repl_skin.py | Sync REPL skin template (banner/prompt/help/goodbye). |
| libreoffice/agent-harness/cli_anything/libreoffice/utils/repl_skin.py | Sync REPL skin template; add skill_path auto-detect param. |
| krita/agent-harness/cli_anything/krita/utils/repl_skin.py | Sync REPL skin template; remove krita-specific accent entries. |
| kdenlive/agent-harness/cli_anything/kdenlive/utils/repl_skin.py | Sync REPL skin template; add skill_path auto-detect param. |
| iterm2/agent-harness/cli_anything/iterm2_ctl/utils/repl_skin.py | Sync REPL skin template (banner/prompt/help/goodbye). |
| intelwatch/agent-harness/cli_anything/intelwatch/utils/repl_skin.py | Sync REPL skin template; add skill_path auto-detect param. |
| inkscape/agent-harness/cli_anything/inkscape/utils/repl_skin.py | Sync REPL skin template; add skill_path auto-detect param. |
| godot/agent-harness/cli_anything/godot/utils/repl_skin.py | Sync REPL skin template (banner/prompt/help/goodbye). |
| gimp/agent-harness/cli_anything/gimp/utils/repl_skin.py | Sync REPL skin template; add skill_path auto-detect param. |
| freecad/agent-harness/cli_anything/freecad/utils/repl_skin.py | Sync REPL skin template; remove freecad-specific accent entries. |
| exa/agent-harness/cli_anything/exa/utils/repl_skin.py | Sync REPL skin template (banner/prompt/help/goodbye). |
| eth2-quickstart/agent-harness/cli_anything/eth2_quickstart/utils/repl_skin.py | Sync REPL skin template; add skill_path auto-detect param. |
| drawio/agent-harness/cli_anything/drawio/utils/repl_skin.py | Sync REPL skin template; init signature + accent map changes. |
| dify-workflow/agent-harness/cli_anything/dify_workflow/utils/repl_skin.py | Sync REPL skin template (banner/prompt/help/goodbye). |
| cloudcompare/agent-harness/cli_anything/cloudcompare/utils/repl_skin.py | Sync REPL skin template (banner/prompt/help/goodbye). |
| cloudanalyzer/agent-harness/cli_anything/cloudanalyzer/utils/repl_skin.py | Sync REPL skin template (banner/prompt/help/goodbye). |
| chromadb/agent-harness/cli_anything/chromadb/utils/repl_skin.py | Sync REPL skin template; init signature + accent map changes. |
| cli-anything-plugin/repl_skin.py | Update canonical REPL skin banner/prompt/help/goodbye to “compact” output. |
| browser/agent-harness/cli_anything/browser/utils/tool_result.py | New shared normalization + error/body text extraction helpers for tool results. |
| browser/agent-harness/cli_anything/browser/utils/repl_skin.py | Sync browser REPL skin to canonical template. |
| browser/agent-harness/cli_anything/browser/core/session.py | Add persisted session snapshot load/save with atomic write. |
| browser/agent-harness/cli_anything/browser/core/page.py | Use daemon if running; only mutate session state when tool call succeeded. |
| browser/agent-harness/cli_anything/browser/core/fs.py | Use daemon if running; add ls preflight; unify error detection for cd. |
| browser/agent-harness/cli_anything/browser/browser_cli.py | Load persisted session when daemon is running; unify output + error handling. |
| blender/agent-harness/cli_anything/blender/utils/repl_skin.py | Sync REPL skin template; add skill_path auto-detect param. |
| audacity/agent-harness/cli_anything/audacity/utils/repl_skin.py | Sync REPL skin template; add skill_path auto-detect param. |
| anygen/agent-harness/cli_anything/anygen/utils/repl_skin.py | Sync REPL skin template; init signature + accent map changes. |
| adguardhome/agent-harness/cli_anything/adguardhome/utils/repl_skin.py | Sync REPL skin template; add skill_path auto-detect param. |
| README.md | Link to REPL skin maintenance documentation. |
| .github/workflows/pr-ci.yml | Add PR CI workflow to compile skins and run browser unit tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| sep_parts = [self._c(_DARK_GRAY, _H_LINE * w) for w in col_widths] | ||
| sep_line = self._c(_DARK_GRAY, f" {'───'.join([_H_LINE * w for w in col_widths])}") | ||
| print(sep_line) |
There was a problem hiding this comment.
sep_parts is computed but never used, which makes this separator-building block misleading. Either use sep_parts to build sep_line or remove the unused variable to avoid confusion.
| raw_prompt = self.prompt(project_name, modified, context) | ||
| return input(raw_prompt).strip() | ||
|
|
||
| # ── Sub-prompt input ──────────────────────────────────────────── | ||
|
|
||
| def sub_input(self, prompt_text: str, pt_session=None) -> str: | ||
| """Get input for a sub-prompt (e.g., parameter entry in add flows). | ||
|
|
||
| Uses prompt_toolkit if a session is available, otherwise falls back | ||
| to plain input(). This preserves history and styling consistency. | ||
|
|
||
| Args: | ||
| prompt_text: The prompt to display (e.g., " start_ms: "). | ||
| pt_session: An optional prompt_toolkit PromptSession. | ||
|
|
||
| Returns: | ||
| User input string (stripped). | ||
| """ | ||
| if pt_session is not None: | ||
| return pt_session.prompt(prompt_text).strip() | ||
| else: | ||
| return input(prompt_text).strip() | ||
|
|
||
| # ── Toolbar builder ─────────────────────────────────────────────── | ||
|
|
||
| def bottom_toolbar(self, items: dict[str, str]): |
There was a problem hiding this comment.
ReplSkin.sub_input() was removed here, but openscreen_cli.py still calls skin.sub_input(...) in multiple REPL flows. This will raise AttributeError at runtime. Either restore sub_input() in the skin (preferred if it’s part of the canonical skin API) or update openscreen_cli.py to use an existing input helper (e.g., get_input() / pt_session.prompt() / input()).
| tip = "Type help for commands, quit to exit" | ||
| print(title) |
There was a problem hiding this comment.
skill_path is still auto-detected and documented as being “Displayed in banner”, but print_banner() no longer prints it. This makes the skill_path feature effectively invisible to users/agents and contradicts the surrounding docstrings/HARNESS guidance. Either include the skill path (or at least its basename) in the compact banner output, or remove/adjust the skill_path parameter + documentation so the API matches the behavior.
| tip = "Type help for commands, quit to exit" | |
| print(title) | |
| tip = "Type help for commands, quit to exit" | |
| skill_path = getattr(self, "skill_path", "") | |
| print(title) | |
| if skill_path: | |
| skill_name = os.path.basename(os.path.normpath(skill_path)) | |
| print(f"Skill: {skill_name}") |
Summary
Verification
Notes
workflow_dispatch+pull_requestand no longer contains a branch-specific push trigger.