Skip to content

High-performance browser automation bridge and multi-instance orchestrator with advanced stealth injection and real-time dashboard.

fix(activity): enrich proxy events with action details, clean up stream UI

Boschefc080f891fc
diff --git a/dashboard/src/activities/AgentActivityWorkspace.tsx b/dashboard/src/activities/AgentActivityWorkspace.tsx
index 4d8ca819..cb8dd9e9 100644
--- a/dashboard/src/activities/AgentActivityWorkspace.tsx
+++ b/dashboard/src/activities/AgentActivityWorkspace.tsx
@@ -84,6 +84,14 @@ function matchesVisibleEvent(
if (hiddenSources.includes(event.source)) {
return false;
}
+ // Hide API management calls (sessions, activity queries, health) from the stream
+ if (
+ event.path.startsWith("/api/") ||
+ event.path === "/health" ||
+ event.path === "/metrics"
+ ) {
+ return false;
+ }
if (requireAgentIdentity && !(event.agentId || "").trim()) {
return false;
}
diff --git a/dashboard/src/activities/StreamRow.tsx b/dashboard/src/activities/StreamRow.tsx
index 0aea5e8c..910fa23d 100644
--- a/dashboard/src/activities/StreamRow.tsx
+++ b/dashboard/src/activities/StreamRow.tsx
@@ -30,6 +30,16 @@ function compactId(value: string): string {
return `${value.slice(0, 4)}…${value.slice(-4)}`;
}
+function isDefaultProfile(name: string | undefined): boolean {
+ if (!name) return true;
+ const lower = name.toLowerCase();
+ return lower === "default" || lower === "chrome-profile";
+}
+
+function isApiPath(path: string): boolean {
+ return path.startsWith("/api/") || path === "/health" || path === "/metrics";
+}
+
function quoted(value: string): string {
return `"${value}"`;
}
@@ -138,7 +148,7 @@ export default function StreamRow({
</div>
<div className="mt-4 flex flex-wrap items-center gap-2">
- {event.profileName && (
+ {event.profileName && !isDefaultProfile(event.profileName) && (
<FilterPill
label={`profile:${event.profileName}`}
onClick={() =>
@@ -146,14 +156,6 @@ export default function StreamRow({
}
/>
)}
- {event.instanceId && (
- <FilterPill
- label={`instance:${event.instanceId}`}
- onClick={() =>
- onFilterChange("instanceId", event.instanceId || "")
- }
- />
- )}
</div>
</div>
</div>
@@ -194,7 +196,7 @@ export default function StreamRow({
onClick={() => onFilterChange("tabId", event.tabId || "")}
/>
))}
- {event.profileName && (
+ {event.profileName && !isDefaultProfile(event.profileName) && (
<FilterPill
label={`profile:${event.profileName}`}
onClick={() =>
@@ -202,14 +204,6 @@ export default function StreamRow({
}
/>
)}
- {event.instanceId && (
- <FilterPill
- label={`instance:${event.instanceId}`}
- onClick={() =>
- onFilterChange("instanceId", event.instanceId || "")
- }
- />
- )}
{event.url && (
<span className="dashboard-mono min-w-0 truncate text-[0.68rem] text-text-muted">
{event.url}
diff --git a/internal/orchestrator/proxy.go b/internal/orchestrator/proxy.go
index 859d4e06..6d754405 100644
--- a/internal/orchestrator/proxy.go
+++ b/internal/orchestrator/proxy.go
@@ -1,7 +1,10 @@
package orchestrator
import (
+ "bytes"
+ "encoding/json"
"fmt"
+ "io"
"net/http"
"net/url"
"strings"
@@ -25,6 +28,10 @@ func (o *Orchestrator) proxyTabRequest(w http.ResponseWriter, r *http.Request) {
return
}
+ // Enrich activity with action/navigate details from the request body
+ // before proxying, so the dashboard stream shows meaningful labels.
+ enrichRouteActivity(r)
+
proxyToInstance := func(inst *bridge.Instance) {
activity.EnrichRequest(r, activity.Update{
InstanceID: inst.ID,
@@ -319,6 +326,52 @@ func classifyLaunchError(err error) int {
return 500 // Internal Server Error
}
+// enrichRouteActivity peeks at the request body to extract action/navigate
+// details for the activity stream. This is necessary because the orchestrator
+// proxies requests without parsing them, so activity would otherwise lack
+// action, ref, and URL fields. The body is restored for the downstream handler.
+func enrichRouteActivity(r *http.Request) {
+ if r.Body == nil || r.Method != http.MethodPost {
+ return
+ }
+ path := r.URL.Path
+ isAction := strings.HasSuffix(path, "/action")
+ isNavigate := strings.HasSuffix(path, "/navigate")
+ if !isAction && !isNavigate {
+ return
+ }
+
+ body, err := io.ReadAll(io.LimitReader(r.Body, 8<<10))
+ if err != nil || len(body) == 0 {
+ return
+ }
+ // Restore the body for the downstream proxy
+ r.Body = io.NopCloser(bytes.NewReader(body))
+
+ var peek struct {
+ Kind string `json:"kind"`
+ Ref string `json:"ref"`
+ URL string `json:"url"`
+ Text string `json:"text"`
+ }
+ if json.Unmarshal(body, &peek) != nil {
+ return
+ }
+
+ update := activity.Update{}
+ if isAction && peek.Kind != "" {
+ update.Action = peek.Kind
+ update.Ref = peek.Ref
+ }
+ if isNavigate && peek.URL != "" {
+ update.Action = "navigate"
+ update.URL = peek.URL
+ }
+ if update.Action != "" {
+ activity.EnrichRequest(r, update)
+ }
+}
+
func (o *Orchestrator) singleRunningInstance() *InstanceInternal {
o.mu.RLock()
defer o.mu.RUnlock()