Skip to content

feat: agent to agent feature#32

Merged
xavidop merged 13 commits intomainfrom
xavier/agent-to-agent-testing
Jul 14, 2025
Merged

feat: agent to agent feature#32
xavidop merged 13 commits intomainfrom
xavier/agent-to-agent-testing

Conversation

@xavidop
Copy link
Owner

@xavidop xavidop commented Jul 11, 2025

Improve logging and added agent to agent feature

Summary by CodeRabbit

  • New Features

    • Introduced Agent-to-Agent Testing, enabling AI-driven simulation of realistic user conversations with agents.
    • Added support for configuring agent tests with goals, personas, step limits, user information, and OpenAI model parameters.
    • Enhanced test execution and reporting to distinguish between traditional interaction-based and agent-to-agent tests.
    • Added OpenAI configuration options at suite and test levels for agent tests.
    • Enabled Voiceflow agent-to-agent testing with separate tester agent configuration and API key support.
  • Documentation

    • Added comprehensive guides and YAML examples for Agent-to-Agent Testing across various industries.
    • Updated documentation to clarify test types, configuration, execution details, and best practices.
    • Improved navigation and references in the documentation for easier access to new and existing test features.
    • Added sequence diagrams illustrating Agent-to-Agent testing workflows.
  • Chores

    • Updated dependencies and reorganized documentation configuration for improved maintainability.
    • Enhanced logging during test execution for better traceability and debugging.

@coderabbitai
Copy link

coderabbitai bot commented Jul 11, 2025

Walkthrough

This update introduces comprehensive support for agent-to-agent conversational testing alongside traditional interaction-based tests. It adds new schema definitions, documentation, configuration examples, and core implementation for executing agent-driven tests using OpenAI and Voiceflow. Documentation and navigation are reorganized to clarify the distinction between test types and provide detailed usage guidance for agent testing.

Changes

Files/Paths Change Summary
docs/docs/static/conversationsuite.json, docs/docs/static/conversationtest.json,
docs/docs/static/swagger.json, docs/docs/static/swagger.yaml,
server/docs/docs.go
Added AgentTest, UserInfo, OpenAIConfig, and VoiceflowAgentTesterConfig schema definitions; updated Test and Suite schemas to support agent tests and OpenAI config.
internal/types/tests/testTypes.go Added AgentTest, UserInfo, OpenAIConfig, and VoiceflowAgentTesterConfig structs; updated Test struct for optional Agent and made Interactions optional.
internal/types/tests/suiteTypes.go Added optional OpenAIConfig field to Suite struct.
pkg/test/common.go Added BaseRunner struct and methods for common Voiceflow and OpenAI interaction functionality.
pkg/test/agent-runner.go Added AgentTestRunner struct and methods to execute OpenAI-powered agent-to-agent tests with user info handling.
pkg/test/voiceflow-agent-runner.go Added VoiceflowAgentTestRunner struct and methods to run agent-to-agent tests where a Voiceflow agent acts as tester.
pkg/test/runner.go Updated runTest to support agent tests; added runAgentTest function to dispatch to appropriate runner.
pkg/test/execute.go Added OpenAIConfig field to HTTPSuiteRequest; improved AddLog to sanitize input and log to global logger.
docs/docs/tests/agent-to-agent-tests.md Added comprehensive documentation for agent-to-agent testing including configuration, usage, best practices, and troubleshooting.
docs/docs/tests/examples/agent-to-agent.md Added extensive YAML examples for agent-to-agent tests across various industries and use cases with best practice tips.
docs/docs/tests/interaction-tests.md Clarified and retitled documentation for traditional interaction-based tests.
docs/docs/tests/introduction.md Expanded and restructured introduction to distinguish between traditional interaction and agent-to-agent testing; improved references.
docs/docs/test-platform/test-execution.md Documented agent-to-agent tests, test types, and updated execution metadata descriptions.
docs/docs/test-platform/test-suites.md Simplified YAML/JSON suite example; referenced external schema pages.
docs/mkdocs.yml Reorganized navigation; added agent-to-agent test references and examples; consolidated analytics config.
examples/suite.yaml Renamed existing test ID; added new agent test entries referencing new agent test YAML files.
examples/tests/test_2.yaml Added OpenAI-powered agent test example with persona, goal, max steps, OpenAI config, and user information.
examples/tests/test_3.yaml Added Voiceflow agent-to-agent test example with Voiceflow tester config and OpenAI evaluation config.
go.mod Updated indirect dependencies; removed unused YAML package.
.gitignore Removed test_*.yaml pattern to allow tracking of new test files.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant AgentTestRunner
    participant OpenAI
    participant Voiceflow

    User->>AgentTestRunner: Start agent-to-agent test
    AgentTestRunner->>OpenAI: Build system prompt (persona, goal)
    AgentTestRunner->>Voiceflow: Send launch message
    loop For each step (until goal or maxSteps)
        AgentTestRunner->>OpenAI: Generate next agent action
        AgentTestRunner->>Voiceflow: Send text message
        Voiceflow-->>AgentTestRunner: Return response
        AgentTestRunner->>OpenAI: Evaluate goal achievement
        alt User info requested
            AgentTestRunner->>OpenAI: Invent user info (if missing)
        end
    end
    AgentTestRunner-->>User: Return test result and logs
Loading

Poem

In fields of YAML, rabbits hop with glee,
For agents now can chat as naturally as can be!
With goals and personas, they test and they learn,
Through Voiceflow and OpenAI, new insights they earn.
So here’s to new journeys, with agents so bright—
May your tests be robust, and your flows just right!

((\
( -.-)
o_(")(")

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch xavier/agent-to-agent-testing

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai auto-generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@xavidop xavidop changed the title Xavier/agent to agent testing feat: agent to agent feature Jul 11, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (4)
docs/docs/tests/introduction.md (3)

22-22: Consider improving the introductory phrase.

The static analysis tool suggests replacing "Because of that" with a stronger introductory phrase.

Apply this diff to improve the wording:

-It is important to know which [suites](/tests/suites) and [tests](/tests/interaction-tests) you can build. Because of that, you can find the entire reference on the [Reference](/tests/suites) page. Suites and test are defined as `yaml` files.
+It is important to know which [suites](/tests/suites) and [tests](/tests/interaction-tests) you can build. Therefore, you can find the entire reference on the [Reference](/tests/suites) page. Suites and test are defined as `yaml` files.

33-33: Consider removing "of" for more concise wording.

The static analysis tool suggests removing "of" to improve conciseness.

Apply this diff to improve the wording:

-All of the commands that are available in `voiceflow-cli` to execute the Conversation profiler are located within the [`voiceflow test` subcommand](/cmd/voiceflow_test).
+All commands that are available in `voiceflow-cli` to execute the Conversation profiler are located within the [`voiceflow test` subcommand](/cmd/voiceflow_test).

37-37: Consider improving the introductory phrase.

Similar to line 22, the static analysis tool suggests replacing "Because of that" with a stronger introductory phrase.

Apply this diff to improve the wording:

-It is important to know which [suites](/tests/suites) and [tests](/tests/agent-to-agent-tests) you can build. Because of that, you can find the entire reference on the [Reference](/tests/suites) page. Suites and test are defined as `yaml` files.
+It is important to know which [suites](/tests/suites) and [tests](/tests/agent-to-agent-tests) you can build. Therefore, you can find the entire reference on the [Reference](/tests/suites) page. Suites and test are defined as `yaml` files.
pkg/test/agent-runner.go (1)

455-455: Consider making the OpenAI model configurable.

The model is hardcoded to "gpt-4o". Consider making this configurable through environment variables or configuration to allow flexibility in model selection.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 562efec and f6a197a.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (18)
  • docs/docs/static/conversationsuite.json (3 hunks)
  • docs/docs/static/conversationtest.json (3 hunks)
  • docs/docs/static/swagger.json (3 hunks)
  • docs/docs/static/swagger.yaml (3 hunks)
  • docs/docs/test-platform/test-execution.md (3 hunks)
  • docs/docs/test-platform/test-suites.md (1 hunks)
  • docs/docs/tests/agent-to-agent-tests.md (1 hunks)
  • docs/docs/tests/examples/agent-to-agent.md (1 hunks)
  • docs/docs/tests/interaction-tests.md (1 hunks)
  • docs/docs/tests/introduction.md (2 hunks)
  • docs/mkdocs.yml (2 hunks)
  • examples/suite.yaml (1 hunks)
  • go.mod (1 hunks)
  • internal/types/tests/testTypes.go (1 hunks)
  • pkg/test/agent-runner.go (1 hunks)
  • pkg/test/execute.go (2 hunks)
  • pkg/test/runner.go (3 hunks)
  • server/docs/docs.go (3 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (2)
pkg/test/execute.go (1)
internal/global/vars.go (1)
  • Log (5-5)
pkg/test/runner.go (3)
internal/types/tests/testTypes.go (2)
  • Agent (35-37)
  • Test (3-8)
pkg/test/execute.go (1)
  • LogCollector (29-31)
pkg/test/agent-runner.go (1)
  • NewAgentTestRunner (41-51)
🪛 YAMLlint (1.37.1)
examples/suite.yaml

[error] 7-7: trailing spaces

(trailing-spaces)

🪛 LanguageTool
docs/docs/tests/introduction.md

[style] ~22-~22: Consider using a different introductory phrase to strengthen your wording.
Context: ...tests/interaction-tests) you can build. Because of that, you can find the entire reference on t...

(BECAUSE_OF_THAT)


[style] ~32-~32: Consider removing “of” to be more concise
Context: ... in the same Voiceflow user's session. All of the commands that are available in `voicefl...

(ALL_OF_THE)


[style] ~37-~37: Consider using a different introductory phrase to strengthen your wording.
Context: ...ts/agent-to-agent-tests) you can build. Because of that, you can find the entire reference on t...

(BECAUSE_OF_THAT)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Summary
🔇 Additional comments (40)
go.mod (1)

42-42: LGTM: Dependency updates support new features

The dependency updates for go-openapi libraries align with the new agent-to-agent testing functionality that requires enhanced API documentation and schema support.

Also applies to: 45-45

examples/suite.yaml (1)

5-5: LGTM: Clear distinction between test types

Renaming to "traditional_test" clearly distinguishes this from the new agent-to-agent testing approach.

docs/docs/tests/interaction-tests.md (1)

1-1: LGTM: Clear documentation positioning

The documentation updates effectively position traditional interaction-based tests as one of two distinct testing approaches, with clear terminology and helpful overview context.

Also applies to: 3-4, 8-8

docs/docs/test-platform/test-suites.md (1)

54-54: LGTM: Improved documentation structure

The simplification reduces duplication and creates better separation of concerns by directing users to dedicated reference pages for detailed information.

Also applies to: 58-58

pkg/test/execute.go (1)

4-4: LGTM: Enhanced logging capabilities

The logging improvements support better log formatting (tab removal) and dual logging (local collection + global output), which aligns with the enhanced testing framework requirements.

Also applies to: 35-37, 39-39

docs/docs/tests/introduction.md (2)

1-1: Well-structured documentation update.

The capitalization change improves consistency and professionalism.


11-32: Excellent documentation restructuring.

The clear distinction between Traditional Interaction-Based Testing and Agent-to-Agent Testing provides users with a comprehensive understanding of available testing approaches. The use cases and descriptions are well-articulated.

docs/docs/test-platform/test-execution.md (4)

27-44: Comprehensive test type documentation.

The new "Test Types" section provides clear and detailed explanations of both Traditional Interaction-Based Tests and Agent-to-Agent Testing. The structure, purpose, use cases, and execution details are well-documented.


54-54: Good addition of test type to execution metadata.

Including the test type in the execution history provides valuable context for users reviewing their test runs.


69-69: Valuable addition for agent-to-agent testing.

The mention of agent conversation history for agent-to-agent tests provides important information about the additional insights available for this test type.


73-75: Well-integrated execution types update.

The addition of "Agent Test Executions" to the execution types list appropriately categorizes the new testing capability alongside existing execution types.

docs/mkdocs.yml (2)

59-62: Proper Google Analytics configuration.

The consolidated Google Analytics configuration in the main extra section is well-structured and includes appropriate privacy settings with IP anonymization.


109-114: Well-organized navigation structure.

The navigation updates properly reflect the new agent-to-agent testing documentation structure, providing clear access to both interaction testing and agent-to-agent testing resources, along with the new examples section.

server/docs/docs.go (3)

326-345: Well-structured AgentTest schema definition.

The new tests.AgentTest schema properly defines the required properties for agent-to-agent testing including goal, maxSteps, persona, and userInformation. The structure aligns with the testing framework requirements.


386-388: Appropriate Test schema extension.

The addition of the optional agent property to the tests.Test schema enables support for agent-to-agent testing while maintaining backward compatibility with existing interaction-based tests.


414-424: Clean UserInfo schema definition.

The tests.UserInfo schema is well-defined with appropriate name and value string properties to support user information context in agent tests.

docs/docs/static/swagger.json (3)

320-339: Consistent AgentTest schema definition.

The JSON schema for tests.AgentTest mirrors the Go definition and properly defines all required properties for agent-to-agent testing configuration.


380-382: Proper Test schema extension.

The addition of the optional agent property to the tests.Test schema maintains consistency with the Go schema definition and enables agent-to-agent testing support.


408-418: Well-defined UserInfo schema.

The JSON schema for tests.UserInfo is properly structured and consistent with the Go definition, providing the necessary properties for user information context.

docs/docs/static/swagger.yaml (3)

117-129: LGTM! Well-structured agent test schema definition.

The tests.AgentTest schema is properly defined with appropriate field types. The structure supports the core agent-to-agent testing requirements with goal, persona, maxSteps, and optional userInformation.


156-157: LGTM! Proper integration of agent test option.

The addition of the optional agent field to the tests.Test schema correctly enables support for agent-to-agent tests alongside traditional interaction-based tests.


174-180: LGTM! Simple and effective user info schema.

The tests.UserInfo schema provides a clean key-value structure for storing user information that agents can reference during testing.

internal/types/tests/testTypes.go (3)

6-8: LGTM! Proper struct modification for dual test support.

The addition of omitempty to the Interactions field and the new optional Agent field correctly enables support for both interaction-based and agent-to-agent tests in a single struct.


10-16: LGTM! Well-designed agent test configuration struct.

The AgentTest struct includes all necessary fields for agent testing with appropriate types and serialization tags. The UserInformation slice provides flexibility for passing contextual data to agents.


18-22: LGTM! Simple and effective user info struct.

The UserInfo struct provides a clean key-value structure for storing user information with proper Go conventions and serialization support.

docs/docs/static/conversationtest.json (3)

21-46: LGTM! Comprehensive agent test schema definition.

The AgentTest schema properly defines the required fields (goal, persona, maxSteps) and optional userInformation array. The structure aligns well with the Go struct definition.


113-122: LGTM! Proper test schema modification for dual test support.

The addition of the optional agent property and removal of interactions from the required fields correctly enables support for both test types while maintaining backward compatibility.


139-154: LGTM! Clean user info schema definition.

The UserInfo schema with required name and value string fields provides a straightforward structure for user information storage.

docs/docs/tests/examples/agent-to-agent.md (1)

1-415: LGTM! Comprehensive and well-structured documentation.

This documentation provides excellent examples of agent-to-agent testing across various industries and scenarios. The examples correctly follow the schema definitions and demonstrate realistic use cases. The best practices section at the end provides valuable guidance for effective test creation.

Key strengths:

  • Diverse industry examples (banking, healthcare, e-commerce, etc.)
  • Realistic user personas and scenarios
  • Proper YAML structure following the schema
  • Helpful tips and best practices
  • Progressive complexity from basic to advanced scenarios
pkg/test/runner.go (4)

4-4: LGTM! Appropriate import addition for error handling.

The encoding/json import is correctly added to support the improved error handling in the validation failure messages.


21-25: LGTM! Clean conditional logic for test type detection.

The conditional check for test.Agent != nil properly identifies agent tests and delegates to the appropriate handler while maintaining backward compatibility with interaction-based tests.


53-55: LGTM! Improved error handling with JSON marshaling.

The JSON marshaling of validation failures provides clearer error messages compared to the default Go struct formatting, making debugging easier for users.


62-71: LGTM! Well-structured agent test execution function.

The runAgentTest function follows good separation of concerns by creating a dedicated AgentTestRunner instance and delegating the execution logic. The logging and error handling are appropriate.

docs/docs/static/conversationsuite.json (3)

67-92: Well-structured agent test schema definition.

The AgentTest definition is properly designed with appropriate required fields and clear property types. The structure aligns well with the agent-to-agent testing functionality.


153-168: Good schema evolution for supporting multiple test types.

The modification to make interactions optional while adding the agent property allows the schema to support both traditional interaction-based tests and new agent-to-agent tests. The updated required fields appropriately reflect this flexibility.


185-200: Simple and effective user information schema.

The UserInfo schema is appropriately minimal with just name-value pairs, which provides flexibility for various types of user data.

docs/docs/tests/agent-to-agent-tests.md (2)

1-149: Excellent comprehensive documentation for agent-to-agent testing.

The documentation is well-structured, provides clear explanations with practical examples, and includes helpful best practices. The use of emojis enhances readability, and the content thoroughly covers all aspects of the feature.


129-129: Authentication link verified
The /overview/authentication page exists at docs/docs/overview/authentication.md and is properly listed under “Overview” in mkdocs.yml. No further action needed.

pkg/test/agent-runner.go (2)

53-139: Well-implemented agent test execution logic.

The test execution flow is properly structured with:

  • Clear initialization and setup
  • Proper error handling at each step
  • Comprehensive logging for debugging
  • Goal achievement tracking with final verification

171-223: Good handling of multiple Voiceflow responses.

The implementation properly handles the case where multiple responses are returned by concatenating their messages, which provides a better user experience in the agent testing flow.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

♻️ Duplicate comments (2)
pkg/test/agent-runner.go (2)

36-39: Misleading comment about logging behavior.

The comment states that this method "logs to both the log collector and the global logger for immediate visibility", but the implementation only adds to the log collector. Either update the comment to reflect the actual behavior or add the global logger call.


523-529: Add error handling for type assertions to prevent panics.

The type assertions on lines 523 and 528 could cause runtime panics if the API response structure is unexpected. Add proper type checking to handle edge cases gracefully.

🧹 Nitpick comments (4)
pkg/test/agent-runner.go (4)

54-151: Consider breaking down the large ExecuteAgentTest method.

The ExecuteAgentTest method is quite long (nearly 100 lines) and handles multiple responsibilities including setup, conversation loop, and goal evaluation. Consider extracting logical segments into smaller methods for better readability and maintainability.

For example, extract the conversation loop into a separate method:

+// runConversationLoop handles the main conversation loop
+func (atr *AgentTestRunner) runConversationLoop(agentTest tests.AgentTest, voiceflowResponse []interact.InteractionResponse) (bool, error) {
+	// Move the conversation loop logic here
+}

207-228: Extract message concatenation logic into a separate method.

The logic for concatenating multiple Voiceflow responses is complex and could be extracted into a dedicated method for better readability and reusability.

+// concatenateResponses combines multiple Voiceflow responses into a single response
+func (atr *AgentTestRunner) concatenateResponses(responses []interact.InteractionResponse) []interact.InteractionResponse {
+	// Move the concatenation logic here
+}

500-505: Consider reusing HTTP client for better performance.

A new HTTP client is created for each OpenAI API call, which is inefficient. Consider creating a reusable client as a field of the AgentTestRunner struct.

type AgentTestRunner struct {
	// ... existing fields ...
+	httpClient *http.Client
}

func NewAgentTestRunner(...) *AgentTestRunner {
	return &AgentTestRunner{
		// ... existing fields ...
+		httpClient: &http.Client{},
	}
}

// In callOpenAI method:
-	client := &http.Client{}
-	resp, err := client.Do(req)
+	resp, err := atr.httpClient.Do(req)

327-410: Complex method could benefit from decomposition.

The checkForUserInfoRequest method handles multiple responsibilities including message analysis, information lookup, and fallback matching. Consider breaking it into smaller, focused methods.

+// analyzeInfoRequest uses OpenAI to determine what information is requested
+func (atr *AgentTestRunner) analyzeInfoRequest(voiceflowMessage, agentResponse string) (string, error) {
+	// Move the OpenAI analysis logic here
+}
+
+// findUserInformation looks up user information with fallback matching
+func (atr *AgentTestRunner) findUserInformation(requestedInfo string) (string, bool) {
+	// Move the information lookup logic here
+}
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cff2058 and 2f9a89f.

📒 Files selected for processing (6)
  • docs/docs/tests/agent-to-agent-tests.md (1 hunks)
  • internal/types/tests/suiteTypes.go (1 hunks)
  • internal/types/tests/testTypes.go (2 hunks)
  • pkg/test/agent-runner.go (1 hunks)
  • pkg/test/execute.go (5 hunks)
  • pkg/test/runner.go (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (4)
  • pkg/test/execute.go
  • internal/types/tests/testTypes.go
  • docs/docs/tests/agent-to-agent-tests.md
  • pkg/test/runner.go
🧰 Additional context used
🧬 Code Graph Analysis (1)
internal/types/tests/suiteTypes.go (1)
internal/types/tests/testTypes.go (1)
  • OpenAIConfig (64-67)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Summary
🔇 Additional comments (3)
internal/types/tests/suiteTypes.go (1)

8-8: Clean addition of OpenAI configuration support.

The addition of the OpenAIConfig field to the Suite struct is well-implemented with proper pointer type for optional configuration and appropriate struct tags.

pkg/test/agent-runner.go (2)

62-70: Good OpenAI configuration handling.

The implementation properly handles optional OpenAI configuration with appropriate defaults and logging of the configuration being used.


413-456: Robust fallback mechanism for user information.

The inventUserInformation method includes a good fallback mechanism with sensible defaults when OpenAI fails, ensuring the testing doesn't break due to API issues.

@gitguardian
Copy link

gitguardian bot commented Jul 14, 2025

️✅ There are no secrets present in this pull request anymore.

If these secrets were true positive and are still valid, we highly recommend you to revoke them.
While these secrets were previously flagged, we no longer have a reference to the
specific commits where they were detected. Once a secret has been leaked into a git
repository, you should consider it compromised, even if it was deleted immediately.
Find here more information about risks.


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

♻️ Duplicate comments (1)
pkg/test/agent-runner.go (1)

23-26: Misleading comment about logging behavior.

The comment states that this method "logs to both the log collector and the global logger for immediate visibility", but the implementation only adds to the log collector.

Either update the comment to reflect the actual behavior or add the global logger call:

-// addLog logs to both the log collector and the global logger for immediate visibility
+// addLog logs to the log collector
 func (atr *AgentTestRunner) addLog(message string) {
 	atr.AddLog(message)
 }
🧹 Nitpick comments (6)
pkg/test/common.go (1)

136-146: Use a switch statement for better readability.

Replace the if-else chain with a switch statement as suggested by static analysis.

Apply this diff to improve code readability:

 	for _, msg := range br.chatHistory {
-		if msg.Role != "system" {
-			if msg.Role == "user" {
-				conversationSummary.WriteString(fmt.Sprintf("User: %s\n", msg.Content))
-			} else if msg.Role == "assistant" {
-				conversationSummary.WriteString(fmt.Sprintf("Agent: %s\n", msg.Content))
-			} else {
-				conversationSummary.WriteString(fmt.Sprintf("%s: %s\n", msg.Role, msg.Content))
-			}
+		switch msg.Role {
+		case "system":
+			// Skip system messages
+		case "user":
+			conversationSummary.WriteString(fmt.Sprintf("User: %s\n", msg.Content))
+		case "assistant":
+			conversationSummary.WriteString(fmt.Sprintf("Agent: %s\n", msg.Content))
+		default:
+			conversationSummary.WriteString(fmt.Sprintf("%s: %s\n", msg.Role, msg.Content))
 		}
 	}
examples/tests/test_3.yaml (1)

16-16: Add newline at end of file.

The file is missing a newline character at the end, which is a standard convention.

Add a newline character after the last line to follow YAML best practices.

examples/tests/test_2.yaml (1)

17-17: Add a trailing newline & consider relocating the $schema hint

The linter flags the missing final newline.
Placing the $schema comment at the very top of the file is the de-facto convention for YAML-LS so editors pick it up instantly.

-# yaml-language-server: $schema=https://voiceflow.xavidop.me/static/conversationtest.json
+# yaml-language-server: $schema=https://voiceflow.xavidop.me/static/conversationtest.json
+
docs/docs/tests/introduction.md (3)

22-23: Tighten wording & fix pluralisation

-It is important to know which [suites](/tests/suites) and [tests](/tests/interaction-tests) you can build. Because of that, you can find the entire reference on the [Reference](/tests/suites) page. Suites and test are defined as `yaml` files.
+It is important to know which [suites](/tests/suites) and [tests](/tests/interaction-tests) you can build. Therefore, you can find the entire reference on the [Reference](/tests/suites) page. Suites and tests are defined as **YAML** files.

43-44: Remove superfluous “of” and capitalise product name

-All of the commands that are available in `voiceflow-cli` to execute the Conversation profiler are located within the [`voiceflow test` subcommand](/cmd/voiceflow_test).
+All commands available in `voiceflow-cli` to execute the Conversation Profiler are located within the [`voiceflow test` subcommand](/cmd/voiceflow_test).

48-49: Mirror earlier wording fixes

-It is important to know which [suites](/tests/suites) and [tests](/tests/agent-to-agent-tests) you can build. Because of that, you can find the entire reference on the [Reference](/tests/suites) page. Suites and test are defined as `yaml` files.
+It is important to know which [suites](/tests/suites) and [tests](/tests/agent-to-agent-tests) you can build. Therefore, you can find the entire reference on the [Reference](/tests/suites) page. Suites and tests are defined as **YAML** files.
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2f9a89f and 27c6164.

📒 Files selected for processing (18)
  • .gitignore (0 hunks)
  • docs/docs/static/conversationsuite.json (7 hunks)
  • docs/docs/static/conversationtest.json (5 hunks)
  • docs/docs/static/swagger.json (5 hunks)
  • docs/docs/static/swagger.yaml (5 hunks)
  • docs/docs/tests/agent-to-agent-tests.md (1 hunks)
  • docs/docs/tests/introduction.md (2 hunks)
  • docs/mkdocs.yml (2 hunks)
  • examples/suite.yaml (1 hunks)
  • examples/tests/test_2.yaml (1 hunks)
  • examples/tests/test_3.yaml (1 hunks)
  • internal/types/tests/testTypes.go (2 hunks)
  • pkg/test/agent-runner.go (1 hunks)
  • pkg/test/common.go (1 hunks)
  • pkg/test/execute.go (5 hunks)
  • pkg/test/runner.go (3 hunks)
  • pkg/test/voiceflow-agent-runner.go (1 hunks)
  • server/docs/docs.go (5 hunks)
💤 Files with no reviewable changes (1)
  • .gitignore
🚧 Files skipped from review as they are similar to previous changes (10)
  • examples/suite.yaml
  • docs/mkdocs.yml
  • docs/docs/static/conversationtest.json
  • pkg/test/runner.go
  • docs/docs/static/swagger.json
  • server/docs/docs.go
  • docs/docs/tests/agent-to-agent-tests.md
  • internal/types/tests/testTypes.go
  • docs/docs/static/swagger.yaml
  • pkg/test/execute.go
🧰 Additional context used
🧬 Code Graph Analysis (1)
pkg/test/common.go (7)
pkg/test/execute.go (1)
  • LogCollector (30-32)
pkg/test/agent-runner.go (1)
  • ChatMessage (18-21)
internal/types/tests/testTypes.go (3)
  • OpenAIConfig (71-74)
  • Interaction (32-36)
  • User (38-41)
internal/types/voiceflow/interact/interactResponseTypes.go (1)
  • InteractionResponse (3-6)
pkg/voiceflow/interact.go (1)
  • DialogManagerInteract (16-86)
internal/global/vars.go (1)
  • OpenAIAPIKey (8-8)
internal/utils/closer.go (1)
  • SafeClose (10-14)
🪛 GitHub Check: lint
pkg/test/common.go

[failure] 138-138:
QF1003: could use tagged switch on msg.Role (staticcheck)

🪛 GitHub Actions: golangci-lint
pkg/test/common.go

[error] 138-138: golangci-lint (staticcheck): could use tagged switch on msg.Role (QF1003)

🪛 LanguageTool
docs/docs/tests/introduction.md

[style] ~22-~22: Consider using a different introductory phrase to strengthen your wording.
Context: ...tests/interaction-tests) you can build. Because of that, you can find the entire reference on t...

(BECAUSE_OF_THAT)


[style] ~43-~43: Consider removing “of” to be more concise
Context: ... in the same Voiceflow user's session. All of the commands that are available in `voicefl...

(ALL_OF_THE)


[style] ~48-~48: Consider using a different introductory phrase to strengthen your wording.
Context: ...ts/agent-to-agent-tests) you can build. Because of that, you can find the entire reference on t...

(BECAUSE_OF_THAT)

🪛 YAMLlint (1.37.1)
examples/tests/test_2.yaml

[error] 17-17: no new line character at the end of file

(new-line-at-end-of-file)

examples/tests/test_3.yaml

[error] 16-16: no new line character at the end of file

(new-line-at-end-of-file)

🪛 Gitleaks (8.26.0)
examples/tests/test_3.yaml

13-13: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Summary

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

♻️ Duplicate comments (1)
examples/tests/test_3.yaml (1)

11-13: Remove hard-coded API key and use a placeholder instead.
Leaking even dummy-looking keys sets a bad precedent and will trigger secret-scanners.

-  voiceflowAgentTesterConfig:
-    environmentName: "production"
-    apiKey: "VF.DM.my.key"
+  voiceflowAgentTesterConfig:
+    environmentName: "production"
+    apiKey: "YOUR_VOICEFLOW_API_KEY_HERE"
🧹 Nitpick comments (1)
examples/tests/test_3.yaml (1)

16-16: Terminate file with a newline.

yamllint flags the missing trailing newline (new-line-at-end-of-file).
Add an empty line after line 16 to satisfy linters and maintain POSIX-friendly files.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 27c6164 and fb47180.

📒 Files selected for processing (1)
  • examples/tests/test_3.yaml (1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.37.1)
examples/tests/test_3.yaml

[error] 16-16: no new line character at the end of file

(new-line-at-end-of-file)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Summary

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (1)
pkg/test/common.go (1)

234-241: Add error handling for type assertions to prevent panics.

The type assertions could cause runtime panics if the API response structure is unexpected. Add proper type checking to handle edge cases gracefully.

🧹 Nitpick comments (6)
docs/docs/tests/agent-to-agent-tests.md (4)

16-18: Broken image path – use relative doc-root path

src="/images/openai-agent-to-agent.png" assumes the docs site’s root folder, which breaks when the markdown is rendered under a sub-folder (e.g., /tests/). Use a relative path anchored from the docs root (/docs/images/…) or a sibling relative path (../images/…) that matches the build system.

-  <img alt="OpenAI Agent To agent" src="/images/openai-agent-to-agent.png" />
+  <img alt="OpenAI Agent To agent" src="../../images/openai-agent-to-agent.png" />

29-31: Second diagram likely suffers the same broken path

The Voiceflow diagram uses the same absolute /images/… reference; please adjust consistently with the previous fix.


123-124: Duplicated wording “Testing Testing”

(OpenAI-Powered Testing Testing Only) has the word “Testing” twice.

-#### `userInformation` (OpenAI-Powered Testing Testing Only)
+#### `userInformation` (OpenAI-Powered Testing Only)

85-88: Avoid showing plaintext API keys in docs samples

Using placeholders that resemble real keys (VF.DM.your-tester-agent-api-key) encourages copying sensitive values into source control. Wrap placeholders in angle-brackets or explicitly call out “DO NOT COMMIT”.

-    apiKey: "VF.DM.your-tester-agent-api-key"
+    # ⚠️  DO NOT COMMIT REAL KEYS
+    apiKey: "<VF.DM.YOUR_TESTER_AGENT_API_KEY>"

Also applies to: 151-153

pkg/test/common.go (2)

69-69: Consider making the interaction ID configurable.

The hardcoded ID "agent-interaction" could be made configurable to support different test scenarios or debugging needs.


172-172: Consider making the OpenAI API URL configurable.

The hardcoded API URL could be made configurable to support different endpoints (e.g., for testing, proxies, or regional endpoints).

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fb47180 and a9c086c.

⛔ Files ignored due to path filters (2)
  • docs/docs/images/openai-agent-to-agent.png is excluded by !**/*.png
  • docs/docs/images/voiceflow-agent-to-agent.png is excluded by !**/*.png
📒 Files selected for processing (5)
  • diagrams/agent-to-agent.md (1 hunks)
  • docs/docs/tests/agent-to-agent-tests.md (1 hunks)
  • docs/mkdocs.yml (3 hunks)
  • docs/requirements.txt (1 hunks)
  • pkg/test/common.go (1 hunks)
✅ Files skipped from review due to trivial changes (2)
  • docs/requirements.txt
  • diagrams/agent-to-agent.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/mkdocs.yml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Summary
🔇 Additional comments (1)
docs/docs/tests/agent-to-agent-tests.md (1)

67-70: Verify model name gpt-4o is actually released & accessible

gpt-4o (and gpt-4o-mini) were only announced recently and may not be available to all accounts / regions. If unavailable the CLI will fail at runtime. Either:

  1. Add a note that users must verify availability, or
  2. Default to gpt-4o-mini / gpt-3.5-turbo which have wider access.

Also applies to: 82-85

@xavidop xavidop merged commit e7c2957 into main Jul 14, 2025
10 checks passed
@xavidop xavidop deleted the xavier/agent-to-agent-testing branch July 14, 2025 14:13
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