Skip to content

feat(leadgen & tts): enhance lead capture with dynamic catalogue/validation, and add signed proxy URLs for TTS media - #261

Open
Tharickv75 wants to merge 10 commits into
mainfrom
dev-tj1
Open

Tharickv75 wants to merge 10 commits into
mainfrom
dev-tj1

Conversation

@Tharickv75

Copy link
Copy Markdown
Contributor

Summary

This PR introduces major enhancements to the leadgen action, unifies Google authentication error handling, and adds signed proxy URL support for TTS media delivery:

  • LLM-Driven Leadgen Redesign: Fully shifts leadgen to be driven by skill definitions. Removed static field vocabularies (ask_next, pending_activation, and global default required fields). Introduced support for dynamic optional_fields, explicit validation_errors, normalized decline/refusal values, and bounded optional pools.
  • Authenticated TTS Media Delivery: Added signed proxy URLs (/p/{code}) enabled via JVSPATIAL_PROXY_ENABLED=true so messaging adapters (e.g., WhatsApp/Messenger) and LLM providers can retrieve voice notes anonymously when authentication is enabled.
  • Unified Google Auth Errors: Introduced GoogleAuthRequiredError across Google actions to handle missing credentials, expired refresh tokens, and missing API scopes consistently.

Related issues

Type of change

  • Bug fix (non-breaking)
  • New feature (non-breaking)
  • Breaking change
  • Documentation
  • Chore / tooling / CI

Checklist

  • I read CONTRIBUTING.md and (for subsystem work) the local AGENTS.md.
  • pre-commit run --all-files passes.
  • pytest tests/ passes; I added/updated tests for new behavior.
  • Bug fixes cite file:line in the description.
  • Docs / CHANGELOG.md updated where relevant (entry under [Unreleased]).
  • No ADR was modified in place (changes of decision are written as a new, superseding ADR).

Notes for reviewers

  • Breaking Change: Callers or skills relying on the removed ask_next field or static default fields will need to update to use next_required, optional_fields, and the server-nominated ask directive.
  • Environment Variable: JVSPATIAL_PROXY_ENABLED=true needs to be set in environments where TTS voice notes are delivered via adapters like WhatsApp while main API authentication is active.

Tharickv75 and others added 6 commits October 29, 2026 13:31
…apture

- Introduced open_fields to return relevant fields that can be asked next, enhancing the lead capture process.
- Removed next_ask and next_optional pointers, allowing the model to choose which field to ask next based on open_fields.
- Updated documentation and tests to reflect changes in leadgen behavior and ensure proper functionality.
- Added support for pending activation of fields to streamline user interactions during lead capture.
Bring PR #259 (prefer description over role in agent profile header).
…validation

- Removed `ask_next` and `pending_activation` guard; the model now captures and retrieves results using `optional_fields` and `validation_errors`.
- Updated `validate_fields` to return per-field validation errors while keeping valid values.
- Introduced `optional_fields` function to manage optional questions based on relevance.
- Adjusted documentation to reflect changes in leadgen behavior and updated tests accordingly.
- Version bumped to 0.1.8rc20-dev5.
…dling and optional fields

- Hardened leadgen base procedure to capture withheld values as decline values, ensuring accurate field responses.
- Introduced a cap on optional fields to five keys to maintain a bounded menu for user interactions.
- Updated validation logic to handle decline values more effectively, including new checks for declined keys.
- Adjusted documentation to reflect changes in leadgen behavior and updated relevant tests.
- Version bumped to 0.1.8rc20-dev6.
… version 0.1.8rc20

- Changed the branch in Dockerfile.base from dev-tj1 to main for cloning jvagent.
- Updated auto-tag workflow to trigger on pushes to the main branch instead of dev-tj1.
- Bumped version in jvagent/version.py from 0.1.8rc20-dev6 to 0.1.8rc20.
@Tharickv75 Tharickv75 self-assigned this Nov 10, 2026
@Tharickv75
Tharickv75 requested a review from eldonm as a code owner November 10, 2026 05:23
The failed-hand-off directive named a single sales number, stale gap-fill
keys failed skill parse, and the hand-off flag never cleared on a new cycle.
@eldonm

eldonm commented Nov 13, 2026

Copy link
Copy Markdown
Member

Review fixes are in c3ddfd8.

  • Failed-hand-off directive no longer names a phone number. It offers sync.sales_contact, or the action's sales_contact, only when one is set.
  • gap_fill.priority, qualification, and project_qualification parse and are ignored, with a warning.
  • _leadgen_handoff_stated is tied to a snapshot of the handed-off fields. Changing or clearing one of those values states the hand-off again.
  • Tool schemas keep field guidance. Undeclared capture keys come back in validation_errors.
  • A refusal closes further questions only when this payload used a refusal phrase. Organization phrases such as "no company" apply only to organization fields. A stored decline text like Personal does not.
  • The required-field refusal sentence uses field guidance, or "this detail", and does not quote the raw key.
  • Directives stay structural. The hand-off sentence itself stays on the skill.

…n improvements

- Added a new core parameter for hand-off sentence to improve user communication during transitions.
- Updated validation logic to handle decline values more effectively, including the introduction of a decline sentinel.
- Refined the handling of optional fields and sync configurations, allowing for more flexible lead capture processes.
- Enhanced documentation to reflect changes in leadgen behavior and updated relevant tests.
…n 0.1.8rc20

- Changed the branch in Dockerfile.base from dev-tj1 to main for cloning jvagent.
- Updated auto-tag workflow to trigger on pushes to the main branch instead of dev-tj1.
- Bumped version in jvagent/version.py from 0.1.8rc20-dev7 to 0.1.8rc20.
…parameters

- Updated `IntroInteractAction` to publish `intro.first_message` as both orchestration and response-scoped parameters, allowing the executive to see the custom intro when authoring replies and enabling `ReplyAction` to weave the greeting into the same reply.
- Adjusted documentation to clarify the new parameter handling and updated tests to ensure compliance with the new behavior.
- Refined the handling of introductory messages to improve user engagement for first-time visitors.

This branch has not been deployed

No deployments
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