Skip to content

Conversation

@ffranr
Copy link
Contributor

@ffranr ffranr commented Dec 11, 2025

Depends on #1913 (comment)


  • Add an Accept interface with marker implementations for buy and sell accept messages (rfqmsg/accept.go, rfqmsg/buy_accept.go, rfqmsg/sell_accept.go).
  • Consolidate negotiator quote handling into HandleIncomingQuoteRequest to replace separate buy/sell handlers (rfq/negotiator.go, rfq/manager.go).
  • Extend HandleIncomingQuoteRequest coverage with buy/sell rejection and error propagation tests (rfq/negotiator_test.go).

@ffranr ffranr added this to the v0.8 milestone Dec 11, 2025
@ffranr ffranr self-assigned this Dec 11, 2025
@ffranr ffranr added the RFQ Work relating to TAP channel Request For Quote (RFQ). label Dec 11, 2025
@ffranr ffranr changed the title RFQ: refactor and unify incoming quote handling with accept interface and tests rfq: refactor and unify incoming quote handling with accept interface and tests Dec 11, 2025
@gemini-code-assist
Copy link

Summary of Changes

Hello @ffranr, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly refactors the handling of incoming quote requests within the "rfq" package. By introducing a new "Accept" interface and consolidating the logic for both buy and sell quote requests into a single "HandleIncomingQuoteRequest" function, the codebase becomes more streamlined and maintainable. This change reduces code duplication and improves the overall design by promoting a more generic approach to message processing, while also extending test coverage for error scenarios.

Highlights

  • Unified Quote Handling: Consolidated separate buy and sell quote request handlers into a single, generic "HandleIncomingQuoteRequest" function.
  • New Accept Interface: Introduced an "Accept" interface in "rfqmsg" to abstract different types of quote accept messages (buy/sell).
  • Enhanced Test Coverage: Added new test cases to "negotiator_test.go" to cover rejection and error propagation for the unified quote handling.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the handling of incoming buy and sell quote requests by introducing a unified HandleIncomingQuoteRequest function in rfq/negotiator.go. This new function now accepts a generic rfqmsg.Request interface, replacing the previously separate HandleIncomingBuyRequest and HandleIncomingSellRequest functions. The rfq/manager.go file was updated to call this new generic handler. Additionally, the rfqmsg package was enhanced with a new Accept interface and a NewQuoteAcceptFromRequest factory function to create generic accept messages, with BuyAccept and SellAccept types now implementing this interface. Test files were updated to include a mockPortfolioPilot for the generic ResolveRequest and a new test case to verify error handling for both buy and sell requests within the unified HandleIncomingQuoteRequest. Review comments suggest improving code robustness by adding nil checks for the NewQuoteAcceptFromRequest return value, updating a test assertion to reflect a more generic error message, and enhancing documentation for exported functions and structs to clearly describe their purpose and behavior, particularly regarding potential nil returns and the new generic request handling.

@ffranr ffranr moved this from 🆕 New to 👀 In review in Taproot-Assets Project Board Dec 11, 2025
@ffranr ffranr force-pushed the wip/portfolio-pilot/add-ResolveRequest branch from cd9f527 to 9989c28 Compare December 15, 2025 14:32
@ffranr ffranr force-pushed the wip/portfolio-pilot/refactor-HandleIncomingQuoteRequest branch 2 times, most recently from 0c13d83 to db6a57b Compare December 15, 2025 18:42
@ffranr ffranr force-pushed the wip/portfolio-pilot/add-ResolveRequest branch 2 times, most recently from f23fc9f to 6169551 Compare December 16, 2025 19:42
Base automatically changed from wip/portfolio-pilot/add-ResolveRequest to main December 17, 2025 11:37
- Add `Accept` interface to define common behavior for quote accept
  messages.
- Implement `acceptMarker` method in BuyAccept and SellAccept to
  satisfy the interface and keep implementations package-local.
Consolidate negotiator subservice methods HandleIncomingBuyRequest
and HandleIncomingSellRequest into HandleIncomingQuoteRequest.
Add test cases for both buy and sell requests to validate rejection and
error propagation logic.
@ffranr ffranr force-pushed the wip/portfolio-pilot/refactor-HandleIncomingQuoteRequest branch from db6a57b to 0a5fe6c Compare December 17, 2025 12:00
@ffranr ffranr marked this pull request as ready for review December 17, 2025 12:02
@coveralls
Copy link

coveralls commented Dec 17, 2025

Pull Request Test Coverage Report for Build 20302069336

Details

  • 15 of 30 (50.0%) changed or added relevant lines in 5 files are covered.
  • 8306 unchanged lines in 128 files lost coverage.
  • Overall coverage increased (+0.04%) to 56.825%

Changes Missing Coverage Covered Lines Changed/Added Lines %
rfqmsg/buy_accept.go 0 1 0.0%
rfqmsg/sell_accept.go 0 1 0.0%
rfqmsg/accept.go 7 9 77.78%
rfq/negotiator.go 6 17 35.29%
Files with Coverage Reduction New Missed Lines %
fn/context_guard.go 1 91.94%
authmailbox/client.go 2 69.84%
commitment/proof.go 2 87.29%
fn/iter.go 2 62.07%
fn/retry.go 2 92.5%
tapdb/interfaces.go 2 80.83%
tapdb/sqlc/universe.sql.go 2 73.71%
universe/archive.go 2 79.91%
universe_rpc_diff.go 2 76.0%
universe/syncer.go 2 85.93%
Totals Coverage Status
Change from base Build 20301511262: 0.04%
Covered Lines: 65529
Relevant Lines: 115317

💛 - Coveralls

@GeorgeTsagk GeorgeTsagk added this pull request to the merge queue Dec 23, 2025
Merged via the queue into main with commit daf5060 Dec 23, 2025
53 of 54 checks passed
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in Taproot-Assets Project Board Dec 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog RFQ Work relating to TAP channel Request For Quote (RFQ).

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

[feature]: PortfolioPilot - Outsourcing All Market and Portfolio-Related Decision-Making During RFQ

5 participants