Skip to content

fix: replace and verify native fill values (TKT-996) - #2756

Merged
Nikhil (shadowfax92) merged 3 commits into
mainfrom
fix/tkt-996-fill
Sep 24, 2026
Merged

Nikhil (shadowfax92) merged 3 commits into
mainfrom
fix/tkt-996-fill

Conversation

@shadowfax92

@shadowfax92 Nikhil (shadowfax92) commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes TKT-996: filling a prepopulated field could append, and non-editable fields could report success without changing.

act / run fill
  validate editability and obstruction
  establish native focus and select text
  replace by default (clear=false appends)
  insert through the browser editor
  verify the resolved field value or return an error

Both surfaces share the Rust operation. Trusted input events reach page handlers; unreadable/detached fields cannot be mistaken for empty. Existing matching values are idempotent success. Search readiness and login outcomes require application-specific checks.

Evidence

  • Before: a real MCP fill of a prefilled input failed exact replacement; a read-only fill incorrectly returned success.
    After: replacement, rejected edits, controlled rollback, empty clearing, native events, shadow/cross-site frame focus and explicit append have browser contracts on both surfaces.
  • Root bun run check and bun run test passed; existing lint/Fallow warnings remain.
  • Rust workspace tests and Clippy passed. Independent review completed; accepted append finding fixed and verified.
  • Pinned Magento fixture with the rebuilt server: xbox is set, trusted input fires, and Search enables after its widget debounce.
  • Full real-browser conformance: 135 passed, 0 failed, locally and in Linux CI, using the rebuilt Rust server and isolated browser profiles.

The suite's fixture inventory and an existing stopped-session error assertion were updated to match the actual fixture set and server response.

All checks passed on 0d1c2c935. Linux CI now uses the suite's headless default. Its former Xvfb requirement was for retired hidden-window APIs; the full native-input suite remains enabled.

Merge Danger

Door: two-way; code revert, no schema or data migration.
Blast Radius: MCP fill through act and run. Unsupported controls, rejected/normalized values and wrong focus now produce errors. Fill emits native text-input events; use type/press when keyboard handlers are required.

@github-actions github-actions Bot added the fix label Sep 24, 2026
@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

✅ Tests passed: 3074/3077

Ran 16 of 16 suites (0 not affected by this change).

Suite Passed Failed Skipped
✅ server-agent 207/207 0 0
✅ server-api 274/274 0 0
✅ server-tools 248/248 0 0
✅ server-browser 10/10 0 0
✅ server-integration 10/10 0 0
✅ server-lib 200/200 0 0
✅ server-root 38/41 0 3
✅ agent 463/463 0 0
✅ claw-app 413/413 0 0
✅ claw-onboard 100/100 0 0
✅ app-onboard 84/84 0 0
✅ build 49/49 0 0
✅ release 66/66 0 0
✅ claw-server-rust 777/777 0 0
✅ claw-server-rust-quality passed 0 0
✅ claw-mcp 135/135 0 0

passed = ran successfully but emits no JUnit counts (a lint/format gate).

View workflow run

@shadowfax92
Nikhil (shadowfax92) marked this pull request as ready for review September 24, 2026 02:48
@shadowfax92
Nikhil (shadowfax92) merged commit 8d9a408 into main Sep 24, 2026
31 checks passed
@greptile-apps

greptile-apps Bot commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge; no actionable correctness, security, or repository-rule violations remain.

Summary

This PR centralizes fill behavior in the Rust input layer and strengthens its contract:

  • Validates editability, visibility, obstruction, focus, and attachment before native insertion.
  • Replaces existing text by default while preserving explicit append behavior.
  • Reads the resolved field back and reports rejected, normalized, or detached edits as errors.
  • Adds real-browser coverage across both MCP surfaces, including contenteditable, shadow DOM, cross-site frames, rejected edits, clearing, and trusted events.
  • Runs the browser contract suite using its documented headless default.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[act or run fill] --> B[Resolve ref and frame session]
  B --> C[Validate editable and visible]
  C --> D[Scroll and obstruction check]
  D --> E[Native click and focus]
  E --> F{Replace or append?}
  F -->|Replace| G[Select existing content]
  F -->|Append| H[Collapse selection to end]
  G --> I[Browser-native text insertion]
  H --> I
  I --> J[Read resolved field value]
  J --> K{Matches expected value?}
  K -->|Yes| L[Return success]
  K -->|No| M[Return fill error]
Loading

Reviews (1) · Last reviewed commit: "ci: run MCP contracts with the supported..."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant