Fence browser observations by generation#63
Draft
rgarcia wants to merge 1 commit into
Draft
Conversation
This was referenced Jul 14, 2026
Contributor
Author
|
bugbot run |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
Autofix Details
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Missing TSDoc on observation exports
- Added TSDoc comments to all newly exported observation interfaces, the ObservationChangedError class, and cohortKey to satisfy documentation requirements.
Or push these changes by commenting:
@cursor push 0ee770931c
Preview (0ee770931c)
diff --git a/packages/agent/src/translator/browser-observation.ts b/packages/agent/src/translator/browser-observation.ts
--- a/packages/agent/src/translator/browser-observation.ts
+++ b/packages/agent/src/translator/browser-observation.ts
@@ -1,3 +1,4 @@
+/** Minimal accessibility node shape consumed by browser observation rendering. */
export interface AXNode {
nodeId: string;
ignored?: boolean;
@@ -10,11 +11,13 @@
childIds?: string[];
}
+/** Indexes node ref ordinals within role/name cohorts for stable references. */
export interface NthIndex {
index: Map<string, number>;
cohorts: Map<string, number>;
}
+/** Carries frame/session metadata needed to render and trace an observed node. */
export interface RenderContext {
targetId: string;
frameKey: string;
@@ -25,23 +28,27 @@
cursorIds?: ReadonlySet<number>;
}
+/** One rendered observation line plus source node and render context. */
export interface ObservationLine {
text: string;
refNode?: AXNode;
ctx: RenderContext;
}
+/** Stitched frame tree with node lookup and per-frame render context. */
export interface FrameStitch {
byId: Map<string, AXNode>;
roots: string[];
ctx: RenderContext;
}
+/** Flattened observed node entry paired with the context it came from. */
export interface ObservedNode {
node: AXNode;
ctx: RenderContext;
}
+/** Full browser observation snapshot assembled from stitched frame trees. */
export interface BrowserObservation {
targetId: string;
tree: FrameStitch;
@@ -52,6 +59,7 @@
generations: Map<string, number>;
}
+/** Cached presentation artifact derived from a browser observation snapshot. */
export interface BrowserPresentation {
observation: BrowserObservation;
cacheKey: string;
@@ -59,6 +67,7 @@
shape: string;
}
+/** Signals that observation data changed mid-collection and must be retried. */
export class ObservationChangedError extends Error {
constructor(message = "Browser observation changed during collection") {
super(message);
@@ -80,6 +89,7 @@
return { index, cohorts };
}
+/** Builds a stable cohort identifier from a node's role/name pair. */
export function cohortKey(role: string, name: string): string {
return `${role}\u0000${name}`;
}You can send follow-ups to the cloud agent here.
4067b8b to
0c29b34
Compare
Contributor
Author
|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 0c29b34. Configure here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

summary
stack
size
542 changed lines: 388 additions, 154 deletions.
testing
npm run typechecknpm test --workspace @onkernel/cua-agent— 170 passed, 16 live tests skippedgit diff --check origin/main...HEAD