Skip to content

fix(messaging): prefer flow main when select_app_flow is ambiguous#116

Open
BimaPangestu28 wants to merge 1 commit into
developfrom
fix/select-app-flow-prefer-main
Open

fix(messaging): prefer flow main when select_app_flow is ambiguous#116
BimaPangestu28 wants to merge 1 commit into
developfrom
fix/select-app-flow-prefer-main

Conversation

@BimaPangestu28
Copy link
Copy Markdown
Member

Summary

  • select_app_flow errored with APP_FLOW_NOT_RESOLVED whenever an app pack shipped >1 messaging flow without an explicit default flow.
  • Adds a main fallback (restricted to kind: messaging) between the existing default-name lookup and the single-messaging-flow heuristic.
  • No behavior change for single-flow packs or packs that already define a default flow.

Why

Multi-flow app packs were silently broken. Concrete repro:

supply-chain-demo ships five messaging flows (main, on_message, order_tracking_flow, reorder_flow, stock_check_flow). When the user opens the webchat URL for that bundle and types anything, the runtime logs:

[Error] [demo ingress] messaging pipeline failed provider=messaging-webchat-gui err=select app default flow

…and no flow ever runs (state/runs/messaging/ stays empty, flow.log is empty, parsed events=0 in operator log even though the activity arrived).

The main flow already carries the entrypoint the wizard intends to surface (entrypoints: { default: "show_welcome" }). Treating it as the natural fallback matches the convention gtbundle already uses when it scaffolds packs.

Test plan

  • cargo test -p greentic-start --lib select_app_flow — local: 4/4 pass (2 new, 2 existing unchanged)
  • cargo clippy -p greentic-start --all-targets -- -D warnings — clean locally
  • cargo fmt -p greentic-start --check — clean locally
  • Smoke: rebuild greentic-start against this branch, install over ~/.local/bin/greentic-start, then gtc start supply-chain-demo-bundle → user message in webchat → verify flow main runs (welcome card appears) instead of erroring with select app default flow.
  • Regression check: re-run gtc start hr-onboarding-demo-bundle → still resolves to main via the single-messaging-flow path (no behavior change).

Related

  • greentic-runner #303 / #304 fix the adaptive-card render side (component invocation gets a valid card_spec); together with this PR, the supply-chain-demo bundle should render its welcome card end-to-end.

`select_app_flow` previously errored with `APP_FLOW_NOT_RESOLVED` whenever
an app pack shipped more than one messaging flow without an explicit
`default` flow. That broke any pack that ships a primary `main` flow
alongside auxiliary helpers — e.g. `supply-chain-demo` ships
`main`, `on_message`, `order_tracking_flow`, `reorder_flow`, and
`stock_check_flow`, all `kind: messaging`.

Add a `main` fallback between the existing `default`-name lookup and the
single-messaging-flow check. The fallback is restricted to messaging
flows so non-messaging domains stay unaffected. Single-flow packs (e.g.
`hr-onboarding-demo`) keep resolving via the existing one-flow path with
no behavior change.

Tests cover three scenarios:
- ambiguous messaging set with a `main` resolves to `main`
- ambiguous set whose `main` is a non-messaging kind still errors
- the prior "exactly two messaging, no `main`" case still errors with
  the same available-flows hint
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.

1 participant