-
Notifications
You must be signed in to change notification settings - Fork 629
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(wren-ui): use intent reasoning instead of hard code string for misleading query #1217
Conversation
WalkthroughThis pull request introduces an Changes
Possibly related PRs
Suggested reviewers
Poem
✨ Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
wren-ui/src/apollo/server/resolvers/askingResolver.ts (1)
Line range hint
1-228
: Architecture implementation is clean and well-structured.The implementation of intent reasoning follows a clean architecture pattern:
- GraphQL schema defines the contract
- Server-side adaptor handles the transformation from snake_case to camelCase
- Resolver properly propagates the field
- Client-side types ensure type safety
The changes are minimal, focused, and maintain consistency across all layers of the application.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (9)
wren-ui/src/apollo/client/graphql/__types__.ts
(1 hunks)wren-ui/src/apollo/client/graphql/home.generated.ts
(2 hunks)wren-ui/src/apollo/client/graphql/home.ts
(1 hunks)wren-ui/src/apollo/server/adaptors/wrenAIAdaptor.ts
(2 hunks)wren-ui/src/apollo/server/models/adaptor.ts
(1 hunks)wren-ui/src/apollo/server/resolvers/askingResolver.ts
(2 hunks)wren-ui/src/apollo/server/schema.ts
(1 hunks)wren-ui/src/components/pages/home/prompt/Result.tsx
(2 hunks)wren-ui/src/components/pages/home/prompt/index.tsx
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: Analyze (go)
🔇 Additional comments (13)
wren-ui/src/apollo/server/models/adaptor.ts (1)
122-124
: LGTM! The type extension is well-defined.The optional
intentReasoning
field is properly typed and maintains backward compatibility.wren-ui/src/components/pages/home/prompt/index.tsx (1)
108-108
: LGTM! The memoized result is properly handled.Good use of optional chaining and fallback to empty string for the
intentReasoning
field.wren-ui/src/apollo/client/graphql/home.ts (1)
131-131
: LGTM! The GraphQL query is properly extended.The
intentReasoning
field is correctly added to theASKING_TASK
query structure.wren-ui/src/components/pages/home/prompt/Result.tsx (2)
43-43
: LGTM! The Props interface is properly extended.The
intentReasoning
field is correctly typed as string in the Props interface.
121-123
: LGTM! The error description fallback chain is well-implemented.Good implementation of the fallback chain:
- First tries
config.description
- Then falls back to
data.intentReasoning
- Finally falls back to error message
wren-ui/src/apollo/server/resolvers/askingResolver.ts (2)
47-47
: LGTM! The interface change is well-structured.The optional
intentReasoning
field is appropriately typed and aligns with the PR's objective of supporting AI-generated intent reasoning.
228-228
: LGTM! Clean implementation of intent reasoning.The field is correctly mapped from the AI service response to the resolver's return object.
wren-ui/src/apollo/server/adaptors/wrenAIAdaptor.ts (2)
510-510
: LGTM! Proper extraction of the intent reasoning field.The snake_case
intent_reasoning
field is correctly destructured from the AI service response.
523-523
: LGTM! Consistent field transformation.The snake_case
intent_reasoning
is properly transformed to camelCaseintentReasoning
in the return object, maintaining consistency with the codebase's naming conventions.wren-ui/src/apollo/server/schema.ts (1)
586-586
: LGTM! GraphQL schema properly extended.The
intentReasoning
field is correctly defined as a nullable String type in the AskingTask type, matching the TypeScript interface.wren-ui/src/apollo/client/graphql/__types__.ts (1)
30-30
: LGTM! Client-side type definition is consistent.The
intentReasoning
field is properly typed asMaybe<Scalars['String']>
, maintaining type safety and consistency with the GraphQL schema.wren-ui/src/apollo/client/graphql/home.generated.ts (2)
28-28
: LGTM! Type definition properly extended.The
intentReasoning
field is correctly added to theAskingTaskQuery
type with proper TypeScript optional and nullable type modifiers.
321-321
: LGTM! GraphQL query field properly added.The
intentReasoning
field is correctly added to theaskingTask
query selection set, aligning with the type definition.
Description
AI API
↓ example response
UI screenshots
Summary by CodeRabbit
New Features
intentReasoning
field to provide additional context about task intent across multiple system componentsImprovements