Commit graph

6233 commits

Author SHA1 Message Date
Sarthak Agarwal
56304b5669 line_profiling_changes 2026-01-20 03:58:35 +05:30
HeshamHM28
45e22e0f94
Cf-api Refactor (#2131)
Fixes CF-833
2026-01-19 23:03:57 +05:30
Sarthak Agarwal
229f3c8f1a add ts verification for candidate 2026-01-19 21:44:13 +05:30
Aseem Saxena
21c2900e31
Merge pull request #2251 from codeflash-ai/cf-1014
Correct Tensorflow PRNG seed (cf-1014)
2026-01-19 08:04:54 -08:00
Kevin Turcios
e793993d12
Merge branch 'main' into cf-1014 2026-01-19 10:58:43 -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
48b667062b fix: exclude loop variables from test import fallback
Make get_referenced_names_from_source scope-aware by reusing
UndefinedNameCollector, preventing invalid imports like `i` and `v`
from loop variables in AI-generated tests.
2026-01-18 04:53:34 -05:00
Kevin Turcios
53baee3994
test: add normalize_code helper and update test assertions (#2255)
## Summary
- Add `normalize_code` helper in `tests/conftest.py` for comparing code
while ignoring quote style differences
- Update test assertions to use `normalize_code()` wrapper
- Add unit tests for comprehension instrumentation cases
2026-01-18 04:03:21 -05:00
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
caf48ac5c3
fix: skip instrumentation for function calls inside comprehensions (#2254)
## Summary
- Skip instrumentation for target function calls inside list/set/dict
comprehensions and generator expressions
- Fixes NameError when AI-generated tests use comprehensions like
`[func(x) for x in items]`

---------

Co-authored-by: codeflash-ai[bot] <148906541+codeflash-ai[bot]@users.noreply.github.com>
2026-01-18 03:58:14 -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
d8095c7424 Make it better and work again e2e 2026-01-16 10:03:44 -08:00
mashraf-222
b870c82403
Merge pull request #2218 from codeflash-ai/vsc/enhance-optimization-view
VSC extension enhance optimization view
2026-01-16 16:39:38 +02:00
Mohamed Ashraf
4a87e148ac Merge branch 'vsc/enhance-optimization-view' of https://github.com/codeflash-ai/codeflash-internal into vsc/enhance-optimization-view 2026-01-16 12:59:53 +02:00
mashraf-222
31d0e4fa06
Merge branch 'main' into vsc/enhance-optimization-view 2026-01-16 12:58:21 +02:00
misrasaurabh1
4570e219a6 fixes and refactor 2026-01-16 00:44:11 -08:00
aseembits93
1a29879603 fix 2026-01-15 21:41:09 -08:00
misrasaurabh1
eaed8a5749 jest looper 2026-01-15 21:40:57 -08:00
misrasaurabh1
4f053eae49 First e2e working version js optimizer!! 2026-01-15 20:40:03 -08:00
misrasaurabh1
0ae49fdd87 checkpoint 2026-01-15 17:31:41 -08:00
misrasaurabh1
0f2dc957d8 checkpoint 2026-01-15 17:00:01 -08:00
misrasaurabh1
1c80984933 checkpoint 2026-01-15 15:57:46 -08:00
misrasaurabh1
6f6bceb233 checkpoint 2026-01-15 15:24:07 -08:00
Aseem Saxena
570ea0a14e
Merge pull request #2141 from codeflash-ai/testgen-jit
API Endpoint for rewriting baseline code as a jit function for better test generation
2026-01-15 12:52:48 -08:00
aseembits93
51ef6aa86b newlines 2026-01-15 12:36:45 -08:00
Aseem Saxena
be392e7808
newline 2026-01-15 12:35:26 -08:00
aseembits93
bb7b898ee3 ready to review 2026-01-15 12:33:10 -08:00
misrasaurabh1
87e09c222a wip instrumentation and execution 2026-01-15 12:13:36 -08:00
Aseem Saxena
bb7b15b27c
Merge branch 'main' into testgen-jit 2026-01-15 11:24:27 -08:00
aseembits93
fa0689c1a6 cleaning up 2026-01-15 10:52:11 -08:00
misrasaurabh1
dc36bf5c57 wip 2026-01-14 23:58:35 -08:00
misrasaurabh1
1a63515f47 Initial js support in aiservice 2026-01-14 22:15:27 -08:00
aseembits93
9c4c7126a4 cleaning up 2026-01-14 19:01:43 -08:00
aseembits93
9d9bf41858 cleaning up 2026-01-14 18:53:04 -08:00
Kevin Turcios
69b55cd319
fix: preserve nested functions in test instrumentation (#2246)
# 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-14 21:19:24 -05:00
Kevin Turcios
dd0354883f
Handle optional filename in response (#2245)
# 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-14 20:49:09 -05:00
Kevin Turcios
ca62d68955
fix: prompt adjustment for testgen (#2242)
## Summary
- Preserve nested functions in test instrumentation (skip instrumenting
calls inside nested function definitions)
- Prevent LLM from embedding markdown code fences in generated tests
(updated system prompts)
- Handle optional filename in python code blocks (e.g.,
`\`\`\`python:filename.py`)

## Test plan
- [x] Unit tests added for nested function preservation
- [x] Unit test for optional filename parsing
- [ ] Manual testing with generated tests
2026-01-14 20:27:43 -05:00
Kevin Turcios
286e76a9f0
fix: Improve symbol resolution for test generation (#2241)
## Summary
- Include private symbols when resolving undefined names in generated
tests
- Resolve symbols imported by source module in generated tests  
- Add fallback for symbols referenced but not defined in source snippet
- Ensure LocalDefinitionRemover only removes top-level definitions
(preserves nested classes/functions)
- Performance optimization for `get_symbols_from_source_code` function

## Test plan
- [x] Unit tests added for all new functionality
- [ ] Manual testing with generated tests

---------

Co-authored-by: codeflash-ai[bot] <148906541+codeflash-ai[bot]@users.noreply.github.com>
2026-01-14 20:16:51 -05:00
HeshamHM28
4f324b99ec
fix: remove API keys when a user is removed from an organization (#2234)
Fixes cf-998
# 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-14 23:51:23 +02:00
Mohamed Ashraf
aca72a9f45 making sure optimmization is marked when PR is created 2026-01-14 23:34:02 +02:00
HeshamHM28
1185259d2f
Chore Allow user to login via org form vsc and cli (#2229)
Fixes cf-997


https://github.com/user-attachments/assets/18e0cdd7-2ae8-48ba-9f70-3c67f7a13448

---------

Co-authored-by: Aseem Saxena <aseem.bits@gmail.com>
Co-authored-by: mashraf-222 <ashraf@codeflash.ai>
2026-01-14 23:33:24 +02:00
Mohamed Ashraf
b24283f852 ADDING PR creation feature 2026-01-14 23:04:14 +02:00
Aseem Saxena
930382731d
Merge branch 'main' into testgen-jit 2026-01-14 12:03:08 -08:00
mashraf-222
47954b5cbe
Merge branch 'main' into vsc/enhance-optimization-view 2026-01-14 20:23:23 +02:00
snyk-io[bot]
be8f6e87c5
[Snyk] Security upgrade posthog-js from 1.108.3 to 1.127.0 (#2231)
![snyk-top-banner](https://res.cloudinary.com/snyk/image/upload/r-d/scm-platform/snyk-pull-requests/pr-banner-default.svg)

### Snyk has created this PR to fix 1 vulnerabilities in the npm
dependencies of this project.

#### Snyk changed the following file(s):

- `js/cf-webapp/package.json`




#### Vulnerabilities that will be fixed with an upgrade:

|  | Issue |  
:-------------------------:|:-------------------------
![critical
severity](https://res.cloudinary.com/snyk/image/upload/w_20,h_20/v1561977819/icon/c.png
'critical severity') | Access of Resource Using Incompatible Type
(&#x27;Type Confusion&#x27;)
<br/>[SNYK-JS-PREACT-14897824](https://snyk.io/vuln/SNYK-JS-PREACT-14897824)




---

> [!IMPORTANT]
>
> - Check the changes in this PR to ensure they won't cause issues with
your project.
> - Max score is 1000. Note that the real score may have changed since
the PR was raised.
> - This PR was automatically created by Snyk using the credentials of a
real user.

---

**Note:** _You are seeing this because you or someone else with access
to this repository has authorized Snyk to open fix PRs._

For more information: <img
src="https://api.segment.io/v1/pixel/track?data=eyJ3cml0ZUtleSI6InJyWmxZcEdHY2RyTHZsb0lYd0dUcVg4WkFRTnNCOUEwIiwiYW5vbnltb3VzSWQiOiIxYjNhOGUwNi1mMGJhLTQwN2EtYTY4MC0zNjYwOTM5ODI5MzUiLCJldmVudCI6IlBSIHZpZXdlZCIsInByb3BlcnRpZXMiOnsicHJJZCI6IjFiM2E4ZTA2LWYwYmEtNDA3YS1hNjgwLTM2NjA5Mzk4MjkzNSJ9fQ=="
width="0" height="0"/>
🧐 [View latest project
report](https://app.snyk.io/org/sarthak-aNe3RTvxtiDtBRn3AkWpLk/project/0b2de2f0-9ee9-4749-939b-2fc69740db7f?utm_source&#x3D;github-cloud-app&amp;utm_medium&#x3D;referral&amp;page&#x3D;fix-pr)
📜 [Customise PR
templates](https://docs.snyk.io/scan-using-snyk/pull-requests/snyk-fix-pull-or-merge-requests/customize-pr-templates?utm_source=github-cloud-app&utm_content=fix-pr-template)
🛠 [Adjust project
settings](https://app.snyk.io/org/sarthak-aNe3RTvxtiDtBRn3AkWpLk/project/0b2de2f0-9ee9-4749-939b-2fc69740db7f?utm_source&#x3D;github-cloud-app&amp;utm_medium&#x3D;referral&amp;page&#x3D;fix-pr/settings)
📚 [Read about Snyk's upgrade
logic](https://docs.snyk.io/scan-with-snyk/snyk-open-source/manage-vulnerabilities/upgrade-package-versions-to-fix-vulnerabilities?utm_source=github-cloud-app&utm_content=fix-pr-template)

---

**Learn how to fix vulnerabilities with free interactive lessons:**

🦉 [Access of Resource Using Incompatible Type (&#x27;Type
Confusion&#x27;)](https://learn.snyk.io/lesson/type-confusion/?loc&#x3D;fix-pr)

[//]: #
'snyk:metadata:{"breakingChangeRiskLevel":null,"FF_showPullRequestBreakingChanges":false,"FF_showPullRequestBreakingChangesWebSearch":false,"customTemplate":{"variablesUsed":[],"fieldsUsed":[]},"dependencies":[{"name":"posthog-js","from":"1.108.3","to":"1.127.0"}],"env":"prod","issuesToFix":["SNYK-JS-PREACT-14897824"],"prId":"1b3a8e06-f0ba-407a-a680-366093982935","prPublicId":"1b3a8e06-f0ba-407a-a680-366093982935","packageManager":"npm","priorityScoreList":[null],"projectPublicId":"0b2de2f0-9ee9-4749-939b-2fc69740db7f","projectUrl":"https://app.snyk.io/org/sarthak-aNe3RTvxtiDtBRn3AkWpLk/project/0b2de2f0-9ee9-4749-939b-2fc69740db7f?utm_source=github-cloud-app&utm_medium=referral&page=fix-pr","prType":"fix","templateFieldSources":{"branchName":"default","commitMessage":"default","description":"default","title":"default"},"templateVariants":["updated-fix-title"],"type":"auto","upgrade":["SNYK-JS-PREACT-14897824"],"vulns":["SNYK-JS-PREACT-14897824"],"patch":[],"isBreakingChange":false,"remediationStrategy":"vuln"}'

---------

Co-authored-by: snyk-io[bot] <141718529+snyk-io[bot]@users.noreply.github.com>
Co-authored-by: Sarthak Agarwal <sarthak.saga@gmail.com>
2026-01-14 23:42:29 +05:30
Mohamed Ashraf
f0b105eb18 - Introduced a new array to track content provider disposables, ensuring proper cleanup to prevent memory leaks.
- Added disposal logic before registering new content providers and during cleanup to maintain resource efficiency.
2026-01-14 17:29:15 +02:00
mashraf-222
454f4160c1
Merge branch 'main' into vsc/enhance-optimization-view 2026-01-14 17:19:07 +02:00
Mohamed Ashraf
deef77043c Enhance GitPatchProvider with line ending normalization and improved multi-file diff handling
- Added a function to normalize line endings to LF for consistent patch processing.
- Updated `showPatch` method to always use the native diff editor, removing the webview fallback.
- Improved handling of multi-file patches by opening separate diff editors for each file.
- Enhanced error handling and logging for better debugging and user feedback.
- Removed unused code related to pull request creation and secondary action buttons in the explanation panel.
2026-01-14 17:15:54 +02:00