Repository navigation
Description
Summary
On an iOS simulator, fill() into a React Native secureTextEntry field fails with ENGINE_FAILURE: perform fill failed: No focused text input was available for typing. It fails the same way with a credential password and with a plain string. After the failure, the field's show/hide toggle has been pressed, so the field now shows plain text.
This is the second half of #872. The bullet-only verification error that #872 reported is gone for us, but the toggle press that #872 also noted still happens, and fill now fails before verification. type_secret in agent.act goes through the same fill, so a password sign-in on iOS can't succeed. A model-driven step then makes it worse: it falls back to tapping "Show password", after which type_secret is refused with POLICY_DENIED because the field is no longer a password field.
pressSequentially() on the same field works, and the field stays secure.
Environment
- e2e 0.23.0, @e2e-dev/mobile 0.12.6, agent-device 0.21.36 (also reproduced with plain agent-device
0.21.37-nightly.20261108.152) - iOS 27.0 and iOS 26.3 simulators (iPhone 17 Pro), Xcode 27.1, macOS
- React Native 0.86.3, Expo SDK 57, Release build for the simulator
Reproduction
The password field is a standard TextInput in a row, with the toggle as a sibling to its right:
<View style={{ flexDirection: 'row', alignItems: 'center' }}>
<TextInput style={{ flex: 1 }} placeholder="••••••••" secureTextEntry={!visible} />
<View style={{ paddingRight: 16 }}>
<TouchableOpacity
accessibilityRole="button"
accessibilityLabel={visible ? 'Ukryj hasło' : 'Pokaż hasło'} // Hide / Show password
onPress={() => setVisible(v => !v)}
hitSlop={8}
>
<Ionicons name={visible ? 'eye-off' : 'eye'} size={20} />
</TouchableOpacity>
</View>
</View>The tree reports the field correctly as secure. From agent-device's snapshot:
TextField "you@example.com" rect x21 y365 w360 h19 editable, password:false
SecureTextField "••••••••" rect x21 y449 w324 h19 editable, password:true
Button "Pokaż hasło" rect x345 y448 w20 h21
Test, from a signed-out start (app.clearState() + device.clearKeychain()), with no agent steps:
test('A: fill', async ({ screen }) => {
const user = credentials.user('athlete');
await screen.getByPlaceholder('you@example.com').fill(user.username); // ok
await screen.getByPlaceholder('••••••••').fill(user.password); // fails
});
test('B: pressSequentially', async ({ screen }) => {
const user = credentials.user('athlete');
await screen.getByPlaceholder('you@example.com').fill(user.username);
await screen.getByPlaceholder('••••••••').pressSequentially(process.env.E2E_USER_ATHLETE_PASSWORD ?? '');
await expect(screen.getByLabel('Pokaż hasło')).toBeVisible(); // still secure
await screen.getByText(/^Zaloguj się$/).last().tap();
await expect(screen.getByText('Dziś i jutro')).toBeVisible({ timeout: 30_000 }); // signed in
});× A: fill 16.98s
→ ENGINE_FAILURE: perform fill failed: No focused text input was available for typing.
✓ B: pressSequentially 16.28s
A's sign-in tap and Home check are left out here, since it never gets that far. A plain string also fails when passed to agent-device's own fill (below), so it isn't specific to secrets.
The same thing happens with plain agent-device, outside e2e:
agent-device fill @e6 "probe@example.com" # email: "Filled 17 chars"
agent-device fill @e8 "dummy-pass-123" # secure field: TEXT_INPUT_NOT_FOCUSED
agent-device snapshot -i
# @e8 [text-field] "••••••••" [focused] [editable] <- was [securetextfield]
# @e9 [button] "Ukryj hasło" <- toggle got pressed
# fresh launch:
agent-device press @e8
agent-device type "dummy-pass-123" # "Typed 14 chars", field stays [securetextfield]Runner log for the failing fill:
AGENT_DEVICE_RUNNER_TEXT_ENTRY_FOCUS evidence=input-reports-keyboard-focus polls=1
... phase=focus durationMs=845.3 chars=14 mode=replacement
... phase=initial-resolve durationMs=0.0 chars=14 mode=replacement
... phase=clear durationMs=2972.5 chars=14 mode=replacement
(then TEXT_INPUT_NOT_FOCUSED)
What we think happens
This is inferred from the log and the screen, not checked in the runner source.
Focus succeeds, and the failure follows the ~3 s clear phase of replacement mode. iOS blocks select-all on secure fields, so the clear probably falls back to a caret tap near the field's trailing edge (x ≈ 345). The toggle starts at x = 345, and with hitSlop={8} it reaches into the field, so the tap lands on the toggle. The app flips secureTextEntry, React Native swaps the native input, and the input the runner was holding focus on is gone, hence TEXT_INPUT_NOT_FOCUSED. pressSequentially (focus + keyboard.type) never clears, which is why it works.
Expected
fill() with a credential password or a plain string enters the text into a secure field, the field stays secure, and no control next to the field is pressed.
Possible directions:
- Skip the clear phase when the field is empty (it shows only its placeholder, or the tree reports no value).
- For a
password: truefield, clear with a bounded run of deletes instead of select-all plus a caret tap. - Keep any fallback caret tap inside the field's rect, inset from the edges, so it can't hit a neighbouring control.
Workaround
pressSequentially() with the password as a plain string works. But it refuses a Secret, so the password loses redaction and can't be used through credentials or in agent.act. If pressSequentially could accept a Secret for a password field, that would also unblock this.
Activity
okwasniewski commentedon Nov 8, 2026
Automated review.
Thanks for the detailed repro. Your read is right, confirmed against the agent-device 0.21.36 runner source:
clearTextInput(RunnerTests+TextEntry.swift) treats every.secureTextFieldvalue as unreadable, so it never sees the field as empty and runs the clear even on the firstfillof an empty field.moveCaretToEnd, a tap atframe.minX + frame.width - 4. With the toggle at x=345 andhitSlop={8}, that tap lands on "Pokaż hasło", RN swaps the native input, and the held focus is gone ->TEXT_INPUT_NOT_FOCUSED.pressSequentiallyskips the clear, which is why it works.The fix belongs in the agent-device runner: treat an empty secure field (placeholder or nil value) as empty, clear secure fields with a delete burst first, and only fall back to the caret tap if text remains. e2e side (
nodes.ts,type_secret, redaction) needs no change. We'll track it here and bump the pin once the runner fix ships.Workaround until then:
pressSequentiallyon the password field (losesSecretredaction, as you noted).TanmayOG commentedon Nov 9, 2026
@okwasniewski This is still on agent-device main. Its iOS runner hasn't changed since the 20261108 nightly in the report.
Can I take this up in agent-device?
okwasniewski commentedon Nov 9, 2026
Automated review.
@TanmayOG yes please, the fix belongs in agent-device's iOS runner. Nothing to change on the e2e side. Link the agent-device PR here.
What we found when we probed it (iOS 26.5 sim, RN 0.86):
secureTextEntryis always a.secureTextFieldwhile secure, whatever the other props.clearTextInputcan skip the clear on the first fill.moveCaretToEndedge tap only if the field still holds text.Once it ships in an agent-device release we bump the pin in
@e2e-dev/mobile.TanmayOG commentedon Nov 10, 2026
@okwasniewski PR is up: callstack/agent-device#4350
fix(ios): clear a secure field with deletes before the caret tap (#4350)
Wojtas399 commentedon Nov 13, 2026
Confirmed fixed on
@e2e-dev/mobile0.12.7 (agent-device 0.21.37).My sign-in helper is back to
fill()on the RNsecureTextEntrypassword field with the show/hide toggle, using the password credential, and thepressSequentiallyworkaround is gone. The full suite passes locally on both the iOS simulator and the Android emulator. No more "No focused text input", and the toggle no longer gets pressed.Thanks @TanmayOG for the fix (callstack/agent-device#4350) and @okwasniewski for the triage. Fine to close from my side.
okwasniewski commentedon Nov 16, 2026
Closing: confirmed fixed by the reporter on @e2e-dev/mobile 0.12.7 (agent-device 0.21.37, callstack/agent-device#4350). Thanks @TanmayOG and @Wojtas399.
Automated triage by Claude Code on behalf of the maintainers.