[Bug]: Testing agent turns any non-"true" string into false for scalar boolean parameters

Open Beginner friendly
#82 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
android, kotlin
Domain
backend

Research direction

Start in ConvertInputToAppFunctionDataUseCase.kt, where setParameterValue handles AppFunctionBooleanTypeMetadata with the lenient String.toBoolean(). Compare it with the array branch, which already uses strict parsing and reports an error naming the parameter. Done means scalar Boolean parameters reject unknown strings like "yes" with a clear error, while "true" and "false" in any case still work.

Written by the indexing model from the issue text.

Description

Steps to Reproduce
  1. Call a function with a Boolean parameter from the Debug screen or LLM with the value "yes" or "maybe".
Expected

Either true/false (case-insensitive) is accepted, or conversion fails with a clear error.

Observed

The value is silently converted to false. String elements in boolean arrays are now strict and an
unknown value fails, so scalars and arrays behave differently.

Root cause

setParameterValue uses the lenient String.toBoolean() for AppFunctionBooleanTypeMetadata
(ConvertInputToAppFunctionDataUseCase.kt).

Suggested fix

Use lowercase().toBooleanStrictOrNull() and fail with a message naming the parameter, matching
the array branch.

Found during review of the #62 fix.

Dominant language
Kotlin
Stars
222
Forks
54
Avg merge
1d 11h
Merged PRs (30d)
26

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from android/appfunctions

All issues in android/appfunctions

Similar issues

More Kotlin issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.