Skip to content

fix: VAANI and DOSH now extract active file instead of dumping full workspace#2

Open
AneeshVRao wants to merge 2 commits intomainfrom
fix/vaani-dosh-active-file
Open

fix: VAANI and DOSH now extract active file instead of dumping full workspace#2
AneeshVRao wants to merge 2 commits intomainfrom
fix/vaani-dosh-active-file

Conversation

@AneeshVRao
Copy link
Copy Markdown
Collaborator

Problem

+When a user asked VAANI to generate code (e.g. 'Python mein factorial function likho'), the AI returned all workspace files concatenated with the new code, instead of just the requested function.
+
+## Root Cause
+- vaani_srijan() received the entire workspace blob as code_context and the prompt said 'Return the COMPLETE updated file — keep all existing code intact'
+- dosh_drishti() had the same issue — full workspace passed for debugging instead of just the open file
+- extract_active_file() already existed (used by GYAAN and KARMA) but was not called by VAANI or DOSH
+
+## Fix
+1. vaani_srijan() — now calls extract_active_file(code_context, active_filename) to isolate only the open file before building the prompt
+2. dosh_drishti() — now accepts active_filename parameter and uses extract_active_file() to create focused_context instead of raw code_context
+3. lambda_handler — updated to pass active_filename to dosh_drishti()
+4. Added .gitignore to exclude __pycache__/
+
+## Testing
+- py_compile passes with zero errors
+- Logic verified: when active file is open, only that file's content goes to the AI prompt

- lambda_trigger: Upload audio to S3 before async invoke to avoid 256KB payload limit
- lambda_trigger: Pass audio_s3_key instead of audio_base64 in processor payload
- lambda_processor: Accept audio_s3_key (backward-compatible with audio_base64)
- lambda_processor: Auto-detect audio format (MP3/OGG/FLAC/WAV) from file header bytes
- lambda_processor: Set MediaFormat dynamically from S3 key extension
- lambda_processor: Move import re to top level (was duplicated in 3 functions)
- lambda_processor: Add fallback return in karma_kavach to prevent None return
…orkspace

- vaani_srijan() now calls extract_active_file() to isolate the open file
  before building the prompt, preventing all workspace files being returned
- dosh_drishti() now accepts active_filename and uses extract_active_file()
  for focused debugging context
- Added .gitignore to exclude __pycache__
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