Skip to content

GH#2407: Open navigate targets in the browser - #2408

Closed
superdav42 wants to merge 5 commits into
mainfrom
feature/auto-20260801-091956-gh2407
Closed

superdav42 wants to merge 5 commits into
mainfrom
feature/auto-20260801-091956-gh2407

Conversation

@superdav42

@superdav42 superdav42 commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Route nested sd-ai-agent/navigate requests through the existing browser sd-ai-agent-js/navigate-to callback.
  • Preserve the outer sd-ai-agent/ability-call identity so paused-job result validation and resume behavior remain intact.
  • Restrict browser navigation to the current site and keep the floating-widget bundle within its budget.

Resolves #2407

Worker self-verification

  • PHPUnit: Tests: 4035, Assertions: 18035, Errors: 0, Failures: 0, Skipped: 134
  • Lint: PHP/JS/CSS all clean
  • PHPStan: 0 errors
  • Build: succeeded
  • Bundle: floating-widget and widget-panel budgets passed

aidevops.sh v3.32.209 plugin for OpenCode v1.18.9 with gpt-5.6-terra spent 38m and 485,892 tokens on this as a headless worker.

Summary by CodeRabbit

  • New Features

    • Browser navigation now supports relative paths and same-site URLs.
    • Authorized navigation requests are routed to the browser automatically.
    • Tool execution selects the correct client-side ability when available.
  • Bug Fixes

    • External URL navigation is rejected for improved safety.
    • Design preview galleries appear only when preview data is available.
    • Duplicate ability registrations are avoided for more reliable tool discovery.

@superdav42 superdav42 added the origin:worker Auto-created by pulse labelless backfill (t2112) label Aug 1, 2026
@coderabbitai

coderabbitai Bot commented Aug 1, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 975deebb-a288-43ec-a5db-bbc034eb7ec9

📥 Commits

Reviewing files that changed from the base of the PR and between 713313c and 1f05596.

📒 Files selected for processing (1)
  • tests/SdAiAgent/Core/AgentLoopClientToolsTest.php
🚧 Files skipped from review as they are similar to previous changes (1)
  • tests/SdAiAgent/Core/AgentLoopClientToolsTest.php

📝 Walkthrough

Walkthrough

Changes

Browser navigation flow

Layer / File(s) Summary
Route authorized navigation calls
includes/Core/ClientAbilityRouter.php, tests/SdAiAgent/Core/AgentLoopClientToolsTest.php
Authorized nested sd-ai-agent/navigate calls route to sd-ai-agent-js/navigate-to while preserving call metadata and arguments.
Validate and execute browser navigation
src/abilities/navigation.js, src/store/slices/jobSlice.js, src/abilities/__tests__/navigation.test.js
Navigation accepts paths or URLs, resolves same-origin targets, rejects external URLs, stores valid targets, and uses client_name when available.
Register and render client abilities
includes/Tools/ToolDiscovery.php, src/components/chat-redesign/ToolCard.js
Duplicate ability stubs are skipped, and the preview gallery renders only when previews exist.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant AgentLoop
  participant ClientAbilityRouter
  participant ToolCapabilities
  participant ClientAbilityRegistry
  participant Browser
  AgentLoop->>ClientAbilityRouter: submit nested sd-ai-agent/navigate call
  ClientAbilityRouter->>ToolCapabilities: check navigation capability
  ClientAbilityRouter->>ClientAbilityRegistry: route to sd-ai-agent-js/navigate-to
  ClientAbilityRegistry->>Browser: execute validated same-origin target
  Browser-->>AgentLoop: return navigation result
Loading

Possibly related PRs

Suggested labels: enhancement, review-feedback-scanned

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The changes route navigation, preserve call identity, and reject cross-origin URLs [#2407], but omit the required fallback link or explanation. Add a user-visible fallback link or explanation when browser navigation is unavailable, and add tests for that response path.
Out of Scope Changes check ⚠️ Warning Most changes support navigation, but the ToolCard.js DesignPreviewGallery rendering change is unrelated to the linked issue [#2407]. Move the ToolCard.js change to a separate pull request or document its direct necessity for this navigation fix.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely identifies the main change: opening navigate targets in the browser.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/auto-20260801-091956-gh2407

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown

Missing issue link. This PR references issue #2407, but the PR body doesn't contain a closing keyword.

Add Closes #2407 to the PR description so GitHub auto-links and auto-closes the issue on merge.

@superdav42
superdav42 marked this pull request as ready for review August 1, 2026 16:00
@superdav42

Copy link
Copy Markdown
Contributor Author

Merge summary

  • Nested sd-ai-agent/navigate calls now use the browser callback after tool-result persistence.
  • Browser-side URL handling rejects cross-origin targets and preserves the paused-call identity used on resume.
  • Verified with npm run verify: 4035 PHPUnit tests, 18035 assertions, 0 errors, 0 failures; PHP/JS/CSS lint, PHPStan, build, and bundle budgets pass.

aidevops.sh v3.32.209 plugin for OpenCode v1.18.9 with gpt-5.6-terra spent 39m and 490,581 tokens on this as a headless worker.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/abilities/navigation.js`:
- Around line 22-33: The inputSchema in registerNavigationAbility must reflect
executeNavigateTo’s support for url-only navigation. Add url to the declared
properties and change the required configuration so callers must provide path or
url, not always path, while preserving the existing schema behavior for valid
inputs.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 16f5662b-ba7a-4816-a846-0f1037939c8d

📥 Commits

Reviewing files that changed from the base of the PR and between 9397249 and 16e4b94.

📒 Files selected for processing (7)
  • includes/Core/ClientAbilityRouter.php
  • includes/Tools/ToolDiscovery.php
  • src/abilities/__tests__/navigation.test.js
  • src/abilities/navigation.js
  • src/components/chat-redesign/ToolCard.js
  • src/store/slices/jobSlice.js
  • tests/SdAiAgent/Core/AgentLoopClientToolsTest.php

Comment thread src/abilities/navigation.js
@ultimate-multisite ultimate-multisite Bot added the status:in-review Non-draft PR ready for review/merge label Aug 1, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/abilities/__tests__/navigation.test.js`:
- Around line 41-44: Update the navigation schema assertion in the navigation
ability tests to use oneOf instead of anyOf, enforcing exactly one of path or
url. Add coverage in the relevant executeNavigateTo/schema validation tests for
an input containing both path and url, and assert that the ambiguous input is
rejected.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ca77e731-b869-46d0-873e-3385f946cddc

📥 Commits

Reviewing files that changed from the base of the PR and between 16e4b94 and 713313c.

📒 Files selected for processing (2)
  • src/abilities/__tests__/navigation.test.js
  • src/abilities/navigation.js
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/abilities/navigation.js

Comment thread src/abilities/__tests__/navigation.test.js
@superdav42

Copy link
Copy Markdown
Contributor Author

CI repair feedback routed to issue #2407

This worker PR had terminal failed CI checks. The check details have been appended
to the linked issue body so the next worker can address them.

Terminal failed checks:

Closed by deterministic merge pass (pulse-merge.sh).

@superdav42 superdav42 closed this Aug 10, 2026
@superdav42 superdav42 added the ci-feedback-routed Worker PR with failing CI routed to linked issue for re-dispatch label Aug 10, 2026
@superdav42 superdav42 removed the status:in-review Non-draft PR ready for review/merge label Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-feedback-routed Worker PR with failing CI routed to linked issue for re-dispatch origin:worker Auto-created by pulse labelless backfill (t2112)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

navigation: homepage does not visibly open after navigate ability succeeds

1 participant