Skip to content

fix: accept flow functions in test case function call assertions - #283

Open
alanacevedo wants to merge 1 commit into
mainfrom
alan/devp-618/flow-functions-in-assertions
Open

fix: accept flow functions in test case function call assertions#283
alanacevedo wants to merge 1 commit into
mainfrom
alan/devp-618/flow-functions-in-assertions

Conversation

@alanacevedo

@alanacevedo alanacevedo commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Summary

function_call_assertions only accepted global functions, so an assertion naming a flow function was rejected as unknown. Agent Studio accepts either — the assertion can be created in the UI and read back by poly pull — so the ADK was rejecting files it had just written.

Motivation

DEVP-618

Validation error in test_suite/dummy_test.yaml: Unknown function in assertion: register_phone_number

register_phone_number is at flows/idnv/functions/. Validation fails per project, so while such a test case exists poly validate fails for the whole project and CI goes red on any PR touching it.

Changes

  • TestCase.validate accepts both function prefixes: fn (global) and ft (flow). Unknown names still raise
  • Update the docs that stated the global-only rule as intended

Test strategy

  • Added/updated unit tests
  • Manual CLI testing (poly <command>)
  • Tested against a live Agent Studio project
  • N/A (docs, config, or trivial change)

Three tests in TestCaseTests — global passes, flow passes, unknown still raises. Confirmed the flow test fails on main and passes here. Nothing covered this check before.

Also ran the patched validator over the real adapthealth-usp project offline (219 functions, 166 of them flow-local): the test case that triggered this now validates. Not pushed to Agent Studio.

Checklist

  • ruff check . and ruff format --check . pass
  • pytest passes (1310 passed; 2 posthog_test.py failures are pre-existing on clean main)
  • No breaking changes — this only widens what validates
  • Commit messages follow conventional commits

Note for reviewers

Function steps and start/end functions have no prefix and stay rejected — they aren't LLM-callable. If the platform does accept assertions on them, covering that is harder: the empty prefix also covers every non-function resource, so unmapped names would stop being distinguishable from valid ones.

🤖 Generated with Claude Code

@alanacevedo
alanacevedo requested a review from a team August 24, 2026 16:30
@alanacevedo
alanacevedo requested a review from a team as a code owner August 24, 2026 16:30
@linear-code

linear-code Bot commented Aug 24, 2026

Copy link
Copy Markdown

DEVP-618

@github-actions

This comment has been minimized.

Test case validation built its allowed function set from resources with the
`fn` prefix, so an assertion naming a flow function under
`flows/<flow>/functions/` (prefix `ft`) was rejected as unknown.

Agent Studio accepts either: such an assertion can be created in the UI and is
read back by `poly pull`, so the ADK rejected files it had itself just written,
and validation failed for the whole project until the test case was removed.

Both prefixes now count. Unknown names still raise, so typos are still caught.

DEVP-618

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@alanacevedo
alanacevedo force-pushed the alan/devp-618/flow-functions-in-assertions branch from 6de616d to 95f38dd Compare August 24, 2026 16:39
@github-actions

Copy link
Copy Markdown
Contributor

Coverage Report

Base (main) PR Change
75.6% 75.6% +0.0% ✅

Changed file coverage

File Coverage Change
poly/resources/test_suite.py 89.4% +0.3% ✅

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants