feat: provide origin question and returning invalid sql when adjusting#1528
feat: provide origin question and returning invalid sql when adjusting#1528
Conversation
WalkthroughThis update enhances the feedback and adjustment task flows by adding two key properties: Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant Tracker
participant AIAdaptor
participant Server
participant Resolver
Client->>Tracker: Initiate adjustment task (with question)
Tracker->>AIAdaptor: Call createAskFeedback (pass question)
AIAdaptor->>Server: POST /v1/ask-feedbacks (payload includes question)
Server-->>AIAdaptor: Response (returns invalid_sql field)
AIAdaptor->>Resolver: transformAskFeedbackResult (maps invalid_sql to invalidSql)
Resolver->>Client: Returns AdjustmentTask (includes invalidSql)
Possibly related PRs
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
🧰 Additional context used🧬 Code Definitions (1)wren-ui/src/apollo/client/graphql/home.generated.ts (1)
⏰ Context from checks skipped due to timeout of 90000ms (2)
🔇 Additional comments (13)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
wren-ui/src/apollo/server/adaptors/wrenAIAdaptor.ts(2 hunks)wren-ui/src/apollo/server/backgrounds/adjustmentBackgroundTracker.ts(1 hunks)wren-ui/src/apollo/server/models/adaptor.ts(2 hunks)wren-ui/src/apollo/server/resolvers/askingResolver.ts(2 hunks)wren-ui/src/apollo/server/schema.ts(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: Analyze (go)
🔇 Additional comments (7)
wren-ui/src/apollo/server/schema.ts (1)
732-732: Addition of invalidSql field looks goodThe addition of the
invalidSqlfield to theAdjustmentTasktype completes the GraphQL schema changes needed to surface invalid SQL information to clients.wren-ui/src/apollo/server/models/adaptor.ts (2)
297-297: LGTM! Question property added to AskFeedbackInputThe addition of the
questionproperty to theAskFeedbackInputinterface enables passing the original question when requesting feedback, which aligns with the PR objective of providing origin question during adjustment.
322-322: LGTM! InvalidSql property added to AskFeedbackResultAdding the
invalidSqlproperty to theAskFeedbackResultinterface provides a way to capture SQL validation issues in the feedback response. This properly implements the "returning invalid sql when adjusting" part of the PR objective.wren-ui/src/apollo/server/backgrounds/adjustmentBackgroundTracker.ts (1)
211-211: Origin question now included when rerunning adjustment tasksGood addition - this ensures that when re-running an adjustment task, the original question is included in the feedback request, allowing proper context to be maintained.
wren-ui/src/apollo/server/resolvers/askingResolver.ts (1)
49-49: Interface update for invalidSql in AdjustmentTaskThe addition of the
invalidSqloptional string property to theAdjustmentTaskinterface correctly matches the GraphQL schema definition.wren-ui/src/apollo/server/adaptors/wrenAIAdaptor.ts (2)
660-671: LGTM! The question property addition is appropriate.The addition of the
questionproperty to the request body ensures that the original question is included when sending feedback to the AI service. This aligns with the PR objective of providing the origin question.
717-729: LGTM! The invalidSql property addition is appropriate.The addition of the
invalidSqlproperty to the feedback result allows for properly capturing and propagating information about invalid SQL responses from the AI service. This implementation correctly maps from the snake_caseinvalid_sqlin the response body to the camelCaseinvalidSqlin the result object, maintaining consistent naming conventions.

Provide origin question and returning invalid sql when adjusting.
Relate to PR: #1526
Summary by CodeRabbit
Summary by CodeRabbit