FLARE Protocol Codegen Project to Feature Branch - #662
Open
constewart9 wants to merge 45 commits into
Open
constewart9 wants to merge 45 commits into
constewart9 wants to merge 45 commits into
Conversation
constewart9
force-pushed
the
conorstw/types-NEW
branch
from
August 14, 2025 16:05
7688617 to
0c0c6f4
Compare
…into conorstw/types-NEW
Conorstw/types new
test: add tests to github action
Remove lsp4j addition, moved to generated pom.xml
Conorstw/types new
manodnyab
reviewed
Aug 15, 2025
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20.x' |
| "dependencies": { | ||
| "@aws/language-server-runtimes-types": "^0.1.56" | ||
| "@aws/language-server-runtimes-types": "^0.1.56", | ||
| "@local/language-server-runtimes-generated-types": "file:../types/codegen/generated/typescript" |
Contributor
There was a problem hiding this comment.
can you please add a comment here on what the final state should be?
## Problem PAC (Proxy Auto-Configuration) file URLs were being returned directly as proxy URLs, causing the HTTP agent to attempt CONNECT requests to PAC file servers instead of parsing the PAC file to determine the actual proxy configuration. This resulted in "Bad response: 501/400" errors when enterprises used PAC files for proxy configuration. - `501` "Not Implemented": The PAC file server doesn't support the CONNECT method at all (like Python's http.server in the bug report) - `400` "Bad Request": The PAC file server recognizes CONNECT but considers it malformed or inappropriate for that endpoint Issues: - aws/aws-toolkit-vscode#7900 - aws/aws-toolkit-vscode#7878 ## Solution Modified `getMacSystemProxy()` to skip PAC URLs when detected and fall back to manual HTTP/HTTPS proxy settings. This prevents PAC file URLs from being incorrectly used as direct proxy servers while PAC file parsing is not yet implemented TODO: - Implement a PAC parser (This is a significant feature requiring JavaScript evaluation and HTTP fetching, which is why it's currently marked as a TODO) ## Testing 1. Created a simple PAC file server: ``` # Created local.pac with content: function FindProxyForURL(url, host) { return "PROXY localhost:8080"; } ``` ``` # Served using Python: python3 -m http.server 8082 ``` 2. Configured system to use PAC file: ``` sudo networksetup -setautoproxyurl "Wi-Fi" "http://localhost:8082/local.pac" sudo networksetup -setautoproxystate "Wi-Fi" on ``` Test Results: With PAC Configuration: AWS extension incorrectly tried to use PAC file URL as proxy <img width="505" height="161" alt="Screenshot 2025-08-18 at 1 05 49 PM" src="https://github.com/user-attachments/assets/f9d70581-7f34-41c0-83a7-f0324701d288" /> Without PAC: Successfully connected <img width="1624" height="971" alt="Screenshot 2025-08-18 at 1 41 38 PM" src="https://github.com/user-attachments/assets/34db6523-e3ed-4afd-8276-b3c117c5855e" /> <!--- REMINDER: - Read CONTRIBUTING.md first. - Add test coverage for your changes. - Link to related issues/commits. - Testing: how did you test your changes? - Screenshots if applicable --> ## License By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
…#665) 🤖 I have created a release *beep* *boop* --- <details><summary>language-server-runtimes: 0.2.126</summary> ## [0.2.126](Amazon-Q-Developer/language-server-runtimes@language-server-runtimes/v0.2.125...language-server-runtimes/v0.2.126) (2025-08-18) ### Bug Fixes * skip PAC URLs in macOS proxy detection ([Amazon-Q-Developer#664](Amazon-Q-Developer#664)) ([92fb02d](Amazon-Q-Developer@92fb02d)) </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
constewart9
force-pushed
the
conorstw/types-NEW
branch
from
August 19, 2025 04:47
8043228 to
0f17f60
Compare
…eveloper#666) ## Problem VSCode Q chat experiences ~60-second delays when the telemetry endpoint `aws-language-servers.us-east-1.amazonaws.com` is not allowlisted in corporate networks. Root Cause: - Telemetry initialization runs synchronously during LSP server startup - OTLPMetricExporter and OTLPLogExporter each attempt HTTP connections with timeouts - Chat remains unresponsive until all telemetry timeouts complete https://github.com/user-attachments/assets/88f89a4d-5321-4019-a3ec-8e6c87631d77 ## Solution Make telemetry initialization to be non-blocking. Changes: - Wrap telemetry setup in setImmediate() callback - LSP initialization returns immediately with `{ capabilities: {} }` - Telemetry initializes asynchronously in background ## Testing Chat responds quickly even when telemetry URL is blocked https://github.com/user-attachments/assets/463bff7f-df24-4daf-80e9-086b073551f2 <!--- REMINDER: - Read CONTRIBUTING.md first. - Add test coverage for your changes. - Link to related issues/commits. - Testing: how did you test your changes? - Screenshots if applicable --> ## License By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
…ure (Amazon-Q-Developer#589) ## Problem No log output for initializeAuth failure ## Solution Add a timeout before process kill to ensure the buffer flushes Tested locally by directly modifying the prod artifact. Note that the webpacked version appears to only output to `stdout` (instead of `stderr`, which should be expected with a `console.error` <!--- REMINDER: - Read CONTRIBUTING.md first. - Add test coverage for your changes. - Link to related issues/commits. - Testing: how did you test your changes? - Screenshots if applicable --> ## License By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
constewart9
force-pushed
the
conorstw/types-NEW
branch
2 times, most recently
from
August 22, 2025 22:12
2040623 to
5d7fd5e
Compare
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.
Problem
Definitions in
chat.tsare not shared between FLARE and IDE Q plugins. Differences in definitions can lead to runtime errors. Need to move towards a single source of truth that can be used to generate definitions in all client languages, starting with TypeScript.Solution
This tool allows the generation of TypeScript and Java definitions from a single source of truth: an OpenAPI spec JSON file. The chat.ts definitions have been translated to JSON in
chatTypes.json. The TypeScript and Java definitions are then generated by OpenAPI generator along with custom mustache templates to format the output. Configuration options are set in openapitools.json that further customize the generated definitions. The other changes related to imports/exports allow for local testing, however these will change once the types are uploaded to npm and pulled in at build time.To generate definitions, do
npm run generatein types/codegen. Definitions will be generated in generated/src/models/index.ts. To build and test LSR locally with these definitions, runnpm run buildin types/codegen/generated/typescript. Then build LSR as normal. For sake of ease, a script was added in the root package.json callednpm run gen-compwhich performs all of these steps.Developers can place as many JSON files in the
types/codegen/schemaas desired.generate-complete-schema.jsis a script that pieces together all present JSON files, checks for formatting consistency and tests across files for overlapping definition names to prevent errors. The script then dynamically gets the version number and prepends thecomplete-schema.jsonwith the appropriate OpenAPI spec header. This allows devs to split up the types into different JSON files without worrying about headers and catching compatibility issues.This file is then used to generate types in TypeScript and Java. These types are tested to ensure completeness/extraneous definitions generated. If a definition is present in the input schema but missing in either language output, the developer is alerted with an error. Finally, some post processing of the typescript file adds import statements and type aliases that are ignored by the generator. The java generator does not ignore import statements so this step is not necessary for the java files.
NOTE: This contains changes that will be removed once upstream npm and Maven Central are set up for distribution. For example, @ local/language-server-runtimes-generated-types should be renamed to @ aws once npm is configured.
License
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.