Commit graph

218 commits

Author SHA1 Message Date
ali
ec97ebd4e7
more cleanup 2026-01-28 22:23:54 +02:00
ali
dcac02b3f2
abstraction 2026-01-28 21:53:51 +02:00
Kevin Turcios
764a3f8899
Merge branch 'main' into multi-language 2026-01-26 23:59:03 -05:00
Kevin Turcios
0444e32f77
fix: CST tree handling and testgen pipeline improvements (#2310)
## Summary
- Fix CST tree corruption issues that caused 'NoneType' object has no
attribute 'visit' errors
- Consolidate testgen postprocessing into a single pipeline with
tuple-based pattern
- Improve markdown code extraction to prefer filepath-annotated blocks
- Add diagnostic context to optimization failure logs

## Changes
- Handle empty `SimpleStatementLine` and `StatementHandler` body to
prevent malformed CST
- Add trace_id logging to optimization and import failure paths
- Refactor testgen postprocessing into consolidated pipeline
- Fix code extraction for LLM responses with multiple code blocks

## Test plan
- [x] Added integration tests for full testgen pipeline
- [x] Added tests for markdown extraction with filepath preference
- [x] Existing tests pass

---------

Co-authored-by: codeflash-ai[bot] <148906541+codeflash-ai[bot]@users.noreply.github.com>
2026-01-26 23:57:55 -05:00
Kevin Turcios
80be7d2dae fix: resolve type errors and linting issues
- Add language parameter to split_markdown_code and group_code for JS/TS support
- Fix callable type annotation in instrument_javascript.py
- Update testgen_javascript.py to use ChatCompletionMessageParam types
- Add None checks before parse_python_version calls
- Add missing None assertions in test files
- Apply ruff auto-fixes for formatting and unused imports
2026-01-25 01:17:44 -05:00
Kevin Turcios
f04ac67728 merge: resolve conflicts with main
- Accept consolidated markdown utilities from common module
- Use wrap_code_in_markdown with language parameter for language support
- Remove duplicate split_markdown_code implementation
- Add validation for python_version before parsing
2026-01-25 01:00:56 -05:00
Kevin Turcios
d091cd17fe
refactor: consolidate shared utilities (#2289)
- Consolidate shared utilities into `aiservice/common/`
- Remove profanity filtering from optimization pipeline
- Add unit tests for common module
2026-01-25 00:49:48 -05:00
Kevin Turcios
3a304aa00f
Merge branch 'main' into multi-language 2026-01-24 17:42:16 -05:00
Kevin Turcios
7aa4da74f8
feat: improve testgen import resolution and forward reference handling (#2276)
## Summary
- Add forward reference detection and automatic fix with `from
__future__ import annotations`
- Handle aliased imports and chained calls in test instrumentation
- Fix import resolution from correct module in multi-context testgen
- Allow ellipsis in Protocol/abstract method bodies
- Add dataclass constructor notes for LLM about required/positional
arguments
- Add logging to silent exception handlers

## Test plan
- [x] Unit tests added for forward reference detection
- [x] Unit tests added for dataclass constructor notes
- [x] Unit tests added for ellipsis handling in AST
- [x] Unit tests added for chained call instrumentation
- [x] Unit tests extended for add_missing_imports

---------

Co-authored-by: codeflash-ai[bot] <148906541+codeflash-ai[bot]@users.noreply.github.com>
2026-01-24 17:39:38 -05:00
Kevin Turcios
2d8da15932
Acceptance reason in explanation for async (#2207)
# Pull Request Checklist

## Description
- [ ] **Description of PR**: Clear and concise description of what this
PR accomplishes
- [ ] **Breaking Changes**: Document any breaking changes (if
applicable)
- [ ] **Related Issues**: Link to any related issues or tickets

## Testing
- [ ] **Test cases Attached**: All relevant test cases have been
added/updated
- [ ] **Manual Testing**: Manual testing completed for the changes

## Monitoring & Debugging
- [ ] **Logging in place**: Appropriate logging has been added for
debugging user issues
- [ ] **Sentry will be able to catch errors**: Error handling ensures
Sentry can capture and report errors
- [ ] **Avoid Dev based/Prisma logging**: No development-only or
Prisma-specific logging in production code

## Configuration
- [ ] **Env variables newly added**: Any new environment variables are
documented in .env.example file or mentioned in description
---

## Additional Notes
<!-- Add any additional context, screenshots, or notes for reviewers
here -->
2026-01-22 22:28:44 -05:00
Sarthak Agarwal
b095f5d9b8
Merge branch 'main' into multi-language 2026-01-23 03:34:13 +05:30
Kevin Turcios
6f6b5e47e6
replace_definition_with_import as early as possible (#2264)
# Pull Request Checklist

## Description
- [ ] **Description of PR**: Clear and concise description of what this
PR accomplishes
- [ ] **Breaking Changes**: Document any breaking changes (if
applicable)
- [ ] **Related Issues**: Link to any related issues or tickets

## Testing
- [ ] **Test cases Attached**: All relevant test cases have been
added/updated
- [ ] **Manual Testing**: Manual testing completed for the changes

## Monitoring & Debugging
- [ ] **Logging in place**: Appropriate logging has been added for
debugging user issues
- [ ] **Sentry will be able to catch errors**: Error handling ensures
Sentry can capture and report errors
- [ ] **Avoid Dev based/Prisma logging**: No development-only or
Prisma-specific logging in production code

## Configuration
- [ ] **Env variables newly added**: Any new environment variables are
documented in .env.example file or mentioned in description
---

## Additional Notes
<!-- Add any additional context, screenshots, or notes for reviewers
here -->
2026-01-20 17:42:29 -05:00
Kevin Turcios
3a79f03f0a
fix: improve test generation parsing and validation (#2259)
## Summary
- Remove unicode quote sanitization from test code validation
- Rely on individual test validation to filter out tests with syntax
errors (including unicode characters)

## Test plan
- [x] Existing tests pass
- [x] Tests with unicode quote syntax errors are correctly filtered out
during individual validation
2026-01-19 10:23:26 -05:00
Sarthak Agarwal
de7dffbb11 add debug logs 2026-01-19 18:53:13 +05:30
Kevin Turcios
fd16c8b889
Typeagent fixes (#2256)
# Pull Request Checklist

## Description
- [ ] **Description of PR**: Clear and concise description of what this
PR accomplishes
- [ ] **Breaking Changes**: Document any breaking changes (if
applicable)
- [ ] **Related Issues**: Link to any related issues or tickets

## Testing
- [ ] **Test cases Attached**: All relevant test cases have been
added/updated
- [ ] **Manual Testing**: Manual testing completed for the changes

## Monitoring & Debugging
- [ ] **Logging in place**: Appropriate logging has been added for
debugging user issues
- [ ] **Sentry will be able to catch errors**: Error handling ensures
Sentry can capture and report errors
- [ ] **Avoid Dev based/Prisma logging**: No development-only or
Prisma-specific logging in production code

## Configuration
- [ ] **Env variables newly added**: Any new environment variables are
documented in .env.example file or mentioned in description
---

## Additional Notes
<!-- Add any additional context, screenshots, or notes for reviewers
here -->
2026-01-18 03:58:51 -05:00
Kevin Turcios
b64776e284
use AsyncAzureOpenAI (#2253)
# Pull Request Checklist

## Description
- [ ] **Description of PR**: Clear and concise description of what this
PR accomplishes
- [ ] **Breaking Changes**: Document any breaking changes (if
applicable)
- [ ] **Related Issues**: Link to any related issues or tickets

## Testing
- [ ] **Test cases Attached**: All relevant test cases have been
added/updated
- [ ] **Manual Testing**: Manual testing completed for the changes

## Monitoring & Debugging
- [ ] **Logging in place**: Appropriate logging has been added for
debugging user issues
- [ ] **Sentry will be able to catch errors**: Error handling ensures
Sentry can capture and report errors
- [ ] **Avoid Dev based/Prisma logging**: No development-only or
Prisma-specific logging in production code

## Configuration
- [ ] **Env variables newly added**: Any new environment variables are
documented in .env.example file or mentioned in description
---

## Additional Notes
<!-- Add any additional context, screenshots, or notes for reviewers
here -->
2026-01-17 22:44:12 -05:00
Aseem Saxena
14d64da083
Additional Instructions for writing tests compatible with JIT compiled code (#2204)
Plan is to have it behind a jit flag (False by default, passed from cli)
until we have tested it thoroughly.
2026-01-16 10:07:49 -08:00
misrasaurabh1
1a63515f47 Initial js support in aiservice 2026-01-14 22:15:27 -08:00
Kevin Turcios
aa544dc74a
log out trace_id for debugging (#2235)
# Pull Request Checklist

## Description
- [ ] **Description of PR**: Clear and concise description of what this
PR accomplishes
- [ ] **Breaking Changes**: Document any breaking changes (if
applicable)
- [ ] **Related Issues**: Link to any related issues or tickets

## Testing
- [ ] **Test cases Attached**: All relevant test cases have been
added/updated
- [ ] **Manual Testing**: Manual testing completed for the changes

## Monitoring & Debugging
- [ ] **Logging in place**: Appropriate logging has been added for
debugging user issues
- [ ] **Sentry will be able to catch errors**: Error handling ensures
Sentry can capture and report errors
- [ ] **Avoid Dev based/Prisma logging**: No development-only or
Prisma-specific logging in production code

## Configuration
- [ ] **Env variables newly added**: Any new environment variables are
documented in .env.example file or mentioned in description
---

## Additional Notes
<!-- Add any additional context, screenshots, or notes for reviewers
here -->
2026-01-12 20:34:36 -05:00
Kevin Turcios
4f27a23623 remove temperature 2026-01-09 00:07:13 -05:00
Kevin Turcios
99bfbd980d use the centralized config 2026-01-09 00:07:12 -05:00
Kevin Turcios
cf6898eacf use haiku 2026-01-08 23:29:09 -05:00
Kevin Turcios
86f68b6ac7 fix: add postprocessing to fix missing imports in generated tests
When the LLM generates test code, it sometimes redefines classes locally
(like Element, ChunkingOptions) but forgets to import or define others
(like PreChunk), causing NameError at runtime.

This adds a postprocessing step that:
1. Detects undefined names in the generated test code
2. Checks if those names are defined in the source module
3. Adds the missing imports automatically

This is more reliable than relying on prompt instructions which the LLM
sometimes ignores.
2026-01-07 14:12:04 -05:00
Kevin Turcios
2095c31195 Remove print_messages debug output from testgen
Remove the print_messages function and its usage since observability
tooling is now in place. This eliminates verbose system prompt output
during test generation in non-production environments.
2026-01-01 17:42:52 -05:00
Kevin Turcios
78fbbd54cd formatting 2025-12-30 14:55:42 -05:00
Kevin Turcios
a2c0ef6573 Merge main into ty-setup branch 2025-12-30 14:50:29 -05:00
Kevin Turcios
2d78bceb0f missed this one 2025-12-30 02:51:38 -05:00
Kevin Turcios
de89aa3ac5 fix errors related to instrument_tests 2025-12-30 02:44:28 -05:00
Kevin Turcios
0fdade4223 fix type hints related to ChatCompletionMessageParam 2025-12-30 02:05:02 -05:00
Kevin Turcios
5b91b0e047 fix these type hints 2025-12-30 01:53:44 -05:00
Kevin Turcios
664c66e7c3 run the formatter 2025-12-30 01:17:03 -05:00
Kevin Turcios
36b5ae44f1 Merge branch 'main' into test_gen_for_diversity 2025-12-29 22:49:07 -05:00
Sarthak Agarwal
f5a303dd31
removing comments 2025-12-29 22:09:44 +05:30
Sarthak Agarwal
af7f00cdae For diversity in testgen 2025-12-29 22:05:09 +05:30
Kevin Turcios
2bbce5ef53 fix call sequence 2025-12-26 16:06:29 -05:00
Kevin Turcios
f247e59161 simplify here too 2025-12-26 15:02:30 -05:00
Kevin Turcios
63afac1ca8 first pass 2025-12-26 14:41:21 -05:00
Kevin Turcios
2c46242165 reduce abstraction 2025-12-26 14:15:13 -05:00
Kevin Turcios
f0bebecc35 ensure proper cost calculation and observability 2025-12-23 18:23:36 -05:00
Kevin Turcios
273edff3ab unify 2025-12-22 23:51:05 -05:00
Kevin Turcios
e938448e60 unified 2025-12-22 23:28:29 -05:00
Kevin Turcios
d0400c0907 formatting
formatting
2025-12-22 02:59:52 -05:00
Sarthak Agarwal
a3380a2372
Observability V1 (#2101)
closes
https://linear.app/codeflash-ai/issue/CF-909/ai-observability-see-the-history-of-a-trace-id
2025-12-20 03:54:09 +05:30
ali
491aadc7f1
make it work 2025-11-18 20:17:09 +02:00
Aseem Saxena
ae290e8e56 wip 2025-11-18 08:44:58 -08:00
Aseem Saxena
2896cde219 wip 2025-11-18 08:30:54 -08:00
Saurabh Misra
7c1933180a
local setup (#1898)
Signed-off-by: Saurabh Misra <misra.saurabh1@gmail.com>
Co-authored-by: saga4 <saga4@codeflashs-MacBook-Air.local>
Co-authored-by: Sarthak Agarwal <sarthak.saga@gmail.com>
Co-authored-by: Mohamed Ashraf <mohamedashrraf222@gmail.com>
Co-authored-by: Aseem Saxena <aseem.bits@gmail.com>
2025-11-17 12:35:09 -08:00
mohammed ahmed
cd98468dd8
Merge branch 'main' into vsc/demo-optimization 2025-11-06 13:53:51 +02:00
Kevin Turcios
69cb7c7509 use qualified name instead 2025-11-05 17:38:44 -08:00
ali
91670b0465
Merge branch 'main' of github.com:codeflash-ai/codeflash-internal into vsc/demo-optimization 2025-11-05 12:29:09 +02:00