Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 4, 2025

Agent action and tool call execution logic was fragmented across multiple files (ToolCallExecutor, WebDriverToolCallExecutor, BrowserToolCallExecutor), making maintenance difficult and creating circular dependencies.

Changes

Core Consolidation

  • ActionExecutionService: New unified service providing single entry point for all action/tool call operations
    • Handles driver and browser domain execution
    • Integrates validation via ActionValidator
    • Manages ToolCall ↔ Expression conversion (moved from ToolCallExecutor companion)
    • Reuses parser instance for performance

Backward Compatibility

  • ToolCallExecutor: Deprecated, delegates to ActionExecutionService
    • All existing code continues working
    • Companion methods proxy to new service

Migration

  • Updated BrowserPerceptiveAgent and InternalAgentExecutor to use new service directly

Usage

// New approach
val service = ActionExecutionService()
val result = service.execute(toolCall, driver)

// Old approach (still works, deprecated)
val executor = ToolCallExecutor()
val result = executor.execute(toolCall, driver)

Documentation

  • Architecture guide: docs/agent-action-architecture.md
  • Migration examples and API reference included

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • accounts.google.com
    • Triggering command: /opt/google/chrome/chrome --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --ignore-certificate-errors --use-angle=swiftshader-webgl --mute-audio --ignore-certificate-errors --crashpad-handler-pid=5864 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/pulsar-REDACTED/context/groups/test/PULSAR_CHROME/cx.1 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,18077770181039743007,2158993054638788629,262144 --disable-features=PaintHolding --variations-seed-version --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /opt/google/chrome/chrome --headless --disable-gpu --hide-scrollbars --remote-debugging-port=0 --no-default-browser-check --no-first-run --no-startup-window --mute-audio --disable-REDACTED-networking --disable-REDACTED-timer-throttling --disable-client-side-phishing-detection --disable-hang-monitor --disable-popup-blocking --disable-prompt-on-repost --disable-sync --disable-translate --disable-geolocation --disable-blink-features=AutomationControlled --metrics-recording-only --safebrowsing-disable-auto-update --ignore-certificate-errors --remote-allow-origins=* --user-data-dir=/tmp/pulsar-REDACTED/context/groups/test/PULSAR_CHROME/cx.1 --noerrdialogs --ozone-platform=headless --ozone-override-screen-size=800,600 --use-angle=swiftshader-webgl (dns block)
    • Triggering command: /opt/google/chrome/chrome --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --ignore-certificate-errors --use-angle=swiftshader-webgl --mute-audio --ignore-certificate-errors --crashpad-handler-pid=6040 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/pulsar-REDACTED/context/groups/test/PULSAR_CHROME/cx.10 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,8473112549586346978,10068674186288443247,262144 --disable-features=PaintHolding --variations-seed-version --trace-process-track-uuid=3190708989122997041 (dns block)
  • android.clients.google.com
    • Triggering command: /opt/google/chrome/chrome --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --ignore-certificate-errors --use-angle=swiftshader-webgl --mute-audio --ignore-certificate-errors --crashpad-handler-pid=5864 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/pulsar-REDACTED/context/groups/test/PULSAR_CHROME/cx.1 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,18077770181039743007,2158993054638788629,262144 --disable-features=PaintHolding --variations-seed-version --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /opt/google/chrome/chrome --headless --disable-gpu --hide-scrollbars --remote-debugging-port=0 --no-default-browser-check --no-first-run --no-startup-window --mute-audio --disable-REDACTED-networking --disable-REDACTED-timer-throttling --disable-client-side-phishing-detection --disable-hang-monitor --disable-popup-blocking --disable-prompt-on-repost --disable-sync --disable-translate --disable-geolocation --disable-blink-features=AutomationControlled --metrics-recording-only --safebrowsing-disable-auto-update --ignore-certificate-errors --remote-allow-origins=* --user-data-dir=/tmp/pulsar-REDACTED/context/groups/test/PULSAR_CHROME/cx.1 --noerrdialogs --ozone-platform=headless --ozone-override-screen-size=800,600 --use-angle=swiftshader-webgl (dns block)
    • Triggering command: /opt/google/chrome/chrome --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --ignore-certificate-errors --use-angle=swiftshader-webgl --mute-audio --ignore-certificate-errors --crashpad-handler-pid=6040 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/pulsar-REDACTED/context/groups/test/PULSAR_CHROME/cx.10 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,8473112549586346978,10068674186288443247,262144 --disable-features=PaintHolding --variations-seed-version --trace-process-track-uuid=3190708989122997041 (dns block)
  • ark.cn-beijing.volces.com
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java -XX:+EnableDynamicAgentLoading -jar /home/REDACTED/work/PulsarRPA/PulsarRPA/pulsar-core/pulsar-third/pulsar-llm/target/surefire/surefirebooter-20251104185738765_77.jar /home/REDACTED/work/PulsarRPA/PulsarRPA/pulsar-core/pulsar-third/pulsar-llm/target/surefire 2025-11-04T18-55-57_281-jvmRun1 surefire-20251104185738765_75tmp surefire_6-20251104185738765_76tmp (dns block)
  • clients2.google.com
    • Triggering command: /opt/google/chrome/chrome --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --ignore-certificate-errors --use-angle=swiftshader-webgl --mute-audio --ignore-certificate-errors --crashpad-handler-pid=5864 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/pulsar-REDACTED/context/groups/test/PULSAR_CHROME/cx.1 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,18077770181039743007,2158993054638788629,262144 --disable-features=PaintHolding --variations-seed-version --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /opt/google/chrome/chrome --headless --disable-gpu --hide-scrollbars --remote-debugging-port=0 --no-default-browser-check --no-first-run --no-startup-window --mute-audio --disable-REDACTED-networking --disable-REDACTED-timer-throttling --disable-client-side-phishing-detection --disable-hang-monitor --disable-popup-blocking --disable-prompt-on-repost --disable-sync --disable-translate --disable-geolocation --disable-blink-features=AutomationControlled --metrics-recording-only --safebrowsing-disable-auto-update --ignore-certificate-errors --remote-allow-origins=* --user-data-dir=/tmp/pulsar-REDACTED/context/groups/test/PULSAR_CHROME/cx.1 --noerrdialogs --ozone-platform=headless --ozone-override-screen-size=800,600 --use-angle=swiftshader-webgl (dns block)
    • Triggering command: /opt/google/chrome/chrome --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --ignore-certificate-errors --use-angle=swiftshader-webgl --mute-audio --ignore-certificate-errors --crashpad-handler-pid=6040 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/pulsar-REDACTED/context/groups/test/PULSAR_CHROME/cx.10 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,8473112549586346978,10068674186288443247,262144 --disable-features=PaintHolding --variations-seed-version --trace-process-track-uuid=3190708989122997041 (dns block)
  • example.com
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java -XX:+EnableDynamicAgentLoading -jar /home/REDACTED/work/PulsarRPA/PulsarRPA/pulsar-core/pulsar-common/target/surefire/surefirebooter-20251104185604366_3.jar /home/REDACTED/work/PulsarRPA/PulsarRPA/pulsar-core/pulsar-common/target/surefire 2025-11-04T18-55-57_281-jvmRun1 surefire-20251104185604366_1tmp surefire_0-20251104185604366_2tmp (dns block)
  • google.com
    • Triggering command: /opt/google/chrome/chrome --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --ignore-certificate-errors --use-angle=swiftshader-webgl --mute-audio --ignore-certificate-errors --crashpad-handler-pid=5864 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/pulsar-REDACTED/context/groups/test/PULSAR_CHROME/cx.1 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,18077770181039743007,2158993054638788629,262144 --disable-features=PaintHolding --variations-seed-version --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /opt/google/chrome/chrome --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --ignore-certificate-errors --use-angle=swiftshader-webgl --mute-audio --ignore-certificate-errors --crashpad-handler-pid=6040 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/pulsar-REDACTED/context/groups/test/PULSAR_CHROME/cx.10 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,8473112549586346978,10068674186288443247,262144 --disable-features=PaintHolding --variations-seed-version --trace-process-track-uuid=3190708989122997041 (dns block)
  • safebrowsingohttpgateway.googleapis.com
    • Triggering command: /opt/google/chrome/chrome --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --ignore-certificate-errors --use-angle=swiftshader-webgl --mute-audio --ignore-certificate-errors --crashpad-handler-pid=5864 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/pulsar-REDACTED/context/groups/test/PULSAR_CHROME/cx.1 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,18077770181039743007,2158993054638788629,262144 --disable-features=PaintHolding --variations-seed-version --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /opt/google/chrome/chrome --headless --disable-gpu --hide-scrollbars --remote-debugging-port=0 --no-default-browser-check --no-first-run --no-startup-window --mute-audio --disable-REDACTED-networking --disable-REDACTED-timer-throttling --disable-client-side-phishing-detection --disable-hang-monitor --disable-popup-blocking --disable-prompt-on-repost --disable-sync --disable-translate --disable-geolocation --disable-blink-features=AutomationControlled --metrics-recording-only --safebrowsing-disable-auto-update --ignore-certificate-errors --remote-allow-origins=* --user-data-dir=/tmp/pulsar-REDACTED/context/groups/test/PULSAR_CHROME/cx.1 --noerrdialogs --ozone-platform=headless --ozone-override-screen-size=800,600 --use-angle=swiftshader-webgl (dns block)
    • Triggering command: /opt/google/chrome/chrome --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --ignore-certificate-errors --use-angle=swiftshader-webgl --mute-audio --ignore-certificate-errors --crashpad-handler-pid=6040 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/pulsar-REDACTED/context/groups/test/PULSAR_CHROME/cx.10 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,8473112549586346978,10068674186288443247,262144 --disable-features=PaintHolding --variations-seed-version --trace-process-track-uuid=3190708989122997041 (dns block)
  • www.aliyun.com
    • Triggering command: /opt/google/chrome/chrome --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --ignore-certificate-errors --use-angle=swiftshader-webgl --mute-audio --ignore-certificate-errors --crashpad-handler-pid=6040 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/pulsar-REDACTED/context/groups/test/PULSAR_CHROME/cx.10 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,8473112549586346978,10068674186288443247,262144 --disable-features=PaintHolding --variations-seed-version --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /opt/google/chrome/chrome --headless --disable-gpu --hide-scrollbars --remote-debugging-port=0 --no-default-browser-check --no-first-run --no-startup-window --mute-audio --disable-REDACTED-networking --disable-REDACTED-timer-throttling --disable-client-side-phishing-detection --disable-hang-monitor --disable-popup-blocking --disable-prompt-on-repost --disable-sync --disable-translate --disable-geolocation --disable-blink-features=AutomationControlled --metrics-recording-only --safebrowsing-disable-auto-update --ignore-certificate-errors --remote-allow-origins=* --user-data-dir=/tmp/pulsar-REDACTED/context/groups/test/PULSAR_CHROME/cx.10 --noerrdialogs --ozone-platform=headless --ozone-override-screen-size=800,600 --use-angle=swiftshader-webgl (dns block)
  • www.baidu.com
    • Triggering command: /opt/google/chrome/chrome --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --ignore-certificate-errors --use-angle=swiftshader-webgl --mute-audio --ignore-certificate-errors --crashpad-handler-pid=5864 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/pulsar-REDACTED/context/groups/test/PULSAR_CHROME/cx.1 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,18077770181039743007,2158993054638788629,262144 --disable-features=PaintHolding --variations-seed-version --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /opt/google/chrome/chrome --headless --disable-gpu --hide-scrollbars --remote-debugging-port=0 --no-default-browser-check --no-first-run --no-startup-window --mute-audio --disable-REDACTED-networking --disable-REDACTED-timer-throttling --disable-client-side-phishing-detection --disable-hang-monitor --disable-popup-blocking --disable-prompt-on-repost --disable-sync --disable-translate --disable-geolocation --disable-blink-features=AutomationControlled --metrics-recording-only --safebrowsing-disable-auto-update --ignore-certificate-errors --remote-allow-origins=* --user-data-dir=/tmp/pulsar-REDACTED/context/groups/test/PULSAR_CHROME/cx.1 --noerrdialogs --ozone-platform=headless --ozone-override-screen-size=800,600 --use-angle=swiftshader-webgl (dns block)
  • www.dongqiudi.com
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java -XX:+EnableDynamicAgentLoading -jar /home/REDACTED/work/PulsarRPA/PulsarRPA/pulsar-core/pulsar-common/target/surefire/surefirebooter-20251104185604366_3.jar /home/REDACTED/work/PulsarRPA/PulsarRPA/pulsar-core/pulsar-common/target/surefire 2025-11-04T18-55-57_281-jvmRun1 surefire-20251104185604366_1tmp surefire_0-20251104185604366_2tmp (dns block)
  • www.google.com
    • Triggering command: /opt/google/chrome/chrome --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --ignore-certificate-errors --use-angle=swiftshader-webgl --mute-audio --ignore-certificate-errors --crashpad-handler-pid=5864 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/pulsar-REDACTED/context/groups/test/PULSAR_CHROME/cx.1 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,18077770181039743007,2158993054638788629,262144 --disable-features=PaintHolding --variations-seed-version --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /opt/google/chrome/chrome --headless --disable-gpu --hide-scrollbars --remote-debugging-port=0 --no-default-browser-check --no-first-run --no-startup-window --mute-audio --disable-REDACTED-networking --disable-REDACTED-timer-throttling --disable-client-side-phishing-detection --disable-hang-monitor --disable-popup-blocking --disable-prompt-on-repost --disable-sync --disable-translate --disable-geolocation --disable-blink-features=AutomationControlled --metrics-recording-only --safebrowsing-disable-auto-update --ignore-certificate-errors --remote-allow-origins=* --user-data-dir=/tmp/pulsar-REDACTED/context/groups/test/PULSAR_CHROME/cx.1 --noerrdialogs --ozone-platform=headless --ozone-override-screen-size=800,600 --use-angle=swiftshader-webgl (dns block)
    • Triggering command: /opt/google/chrome/chrome --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --ignore-certificate-errors --use-angle=swiftshader-webgl --mute-audio --ignore-certificate-errors --crashpad-handler-pid=6040 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/pulsar-REDACTED/context/groups/test/PULSAR_CHROME/cx.10 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,8473112549586346978,10068674186288443247,262144 --disable-features=PaintHolding --variations-seed-version --trace-process-track-uuid=3190708989122997041 (dns block)
  • www.xiaohongshu.com
    • Triggering command: /opt/google/chrome/chrome --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --ignore-certificate-errors --use-angle=swiftshader-webgl --mute-audio --ignore-certificate-errors --crashpad-handler-pid=5864 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/pulsar-REDACTED/context/groups/test/PULSAR_CHROME/cx.1 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,18077770181039743007,2158993054638788629,262144 --disable-features=PaintHolding --variations-seed-version --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /opt/google/chrome/chrome --headless --disable-gpu --hide-scrollbars --remote-debugging-port=0 --no-default-browser-check --no-first-run --no-startup-window --mute-audio --disable-REDACTED-networking --disable-REDACTED-timer-throttling --disable-client-side-phishing-detection --disable-hang-monitor --disable-popup-blocking --disable-prompt-on-repost --disable-sync --disable-translate --disable-geolocation --disable-blink-features=AutomationControlled --metrics-recording-only --safebrowsing-disable-auto-update --ignore-certificate-errors --remote-allow-origins=* --user-data-dir=/tmp/pulsar-REDACTED/context/groups/test/PULSAR_CHROME/cx.1 --noerrdialogs --ozone-platform=headless --ozone-override-screen-size=800,600 --use-angle=swiftshader-webgl (dns block)
    • Triggering command: /opt/google/chrome/chrome --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --ignore-certificate-errors --use-angle=swiftshader-webgl --mute-audio --ignore-certificate-errors --crashpad-handler-pid=6040 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/pulsar-REDACTED/context/groups/test/PULSAR_CHROME/cx.10 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,8473112549586346978,10068674186288443247,262144 --disable-features=PaintHolding --variations-seed-version --trace-process-track-uuid=3190708989122997041 (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Refactor agent action and tool call code structure for maintainability</issue_title>
<issue_description>Currently, the code related to agent actions and tool calls is scattered across multiple files. This fragmentation makes the codebase harder to maintain and update.

Proposed improvements:

  • Consolidate agent action and tool calling logic into dedicated modules or services.
  • Update code references to ensure there is a single, unified approach for invoking tool calls.
  • Document the refactored structure to improve onboarding and future maintenance.
  • Review related files and update dependencies and imports accordingly.

Branch: feat/agent-action-refactor

Rationale:
Centralizing agent action and tool call logic will make maintenance easier, reduce technical debt, and improve readability.

Impact:

  • Improved maintainability
  • Easier feature extension
  • Reduced complexity for debugging

Acceptance Criteria:

  • All agent action and tool calls handled via dedicated module/service
  • Redundant/dispersed implementation removed
  • Documentation updated

If migration or backward compatibility is required, specify a transition path in comments or documentation.</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@galaxyeye galaxyeye marked this pull request as ready for review November 4, 2025 18:47
Copilot AI and others added 4 commits November 4, 2025 19:01
Co-authored-by: galaxyeye <1701451+galaxyeye@users.noreply.github.com>
Co-authored-by: galaxyeye <1701451+galaxyeye@users.noreply.github.com>
Co-authored-by: galaxyeye <1701451+galaxyeye@users.noreply.github.com>
…ove performance

Co-authored-by: galaxyeye <1701451+galaxyeye@users.noreply.github.com>
Copilot AI changed the title [WIP] Refactor agent action and tool call code structure for maintainability Consolidate scattered agent action and tool call execution into unified service Nov 4, 2025
Copilot AI requested a review from galaxyeye November 4, 2025 19:14
Copilot finished work on behalf of galaxyeye November 4, 2025 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants