Conversation
…extual references
✅ Deploy Preview for agent-tars-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
…from query
Breaking change: ContextReferenceProcessor.processContextualReferences now returns
{ expandedContext, originalQuery } instead of merged string. This fixes the design
flaw where context and query were incorrectly combined.
- Fixed environment_input only sent when actual contextual references exist
- Improved conditional logic using expandedContext truthiness check
- Updated all tests to match new interface
- Better separation of concerns between context and user input
…readability - Extracted common test helpers and mock setup - Used vi.hoisted for proper mock initialization - Reduced test file size by ~50% while maintaining coverage - More focused test cases with better naming
Update all test snapshots to match the new return format:
{ expandedContext, originalQuery } instead of merged string
- Fixed 14 test cases in context-reference-processor.test.ts
- All tests now pass with new interface design
- Maintains full test coverage for error handling and edge cases
Remove redundant originalQuery return value - caller already has the query!
- Changed return type from { expandedContext, originalQuery } to string | null
- Only return expanded context when @file/@dir references exist
- Updated all tests to match simplified interface
- Eliminates pointless data duplication in API
Much cleaner design - no more 脱裤子放屁 anti-pattern!
environment_input events without contextual references
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes bug where
environment_inputevents were generated for every user message, even when no@fileor@dircontextual references were present.Problem
environmentInputtoAgent.run(), causing unnecessary eventsSolution
Simplified
ContextReferenceProcessorinterface:Updated controller logic:
Benefits
environment_inputevents when contextual references existstring | nullreturn typeChecklist