Skip to content
This repository was archived by the owner on May 29, 2026. It is now read-only.

Dev#1578

Open
pelikhan wants to merge 647 commits into
mainfrom
dev
Open

Dev#1578
pelikhan wants to merge 647 commits into
mainfrom
dev

Conversation

@pelikhan

Copy link
Copy Markdown
Member

Dev branch.

Comment thread packages/core/src/chat.ts Outdated
Comment thread packages/core/src/mcpclient.ts
Comment thread packages/core/src/types/prompt_template.d.ts Outdated
@pelikhan pelikhan requested a review from bzorn June 2, 2025 21:27
@github-actions

github-actions Bot commented Jun 2, 2025

Copy link
Copy Markdown
Contributor

Annotations from the provided diff:

Linter: no-fix-mes

  • No fixMe comments detected. All clear here.

Linter: grumpy-dev

Sarcastic, grumpy breakdown of the changes:

  1. Removed a GitHub action step: Fine, rip out the "github models" action. Who needs clarity or useful models anyway?
  2. Added custom-action.yml: Another YAML file? Back in my day, we kept these lightweight. Looks like "YAML fatigue" is real.
  3. Changes in Astro app configuration and package.json: Why bump versions? Any rationale? Or just because "latest and greatest" is assumed?
  4. Draft blog posts: Markdown placeholders? Sure, why not bloat the repo with draft fragments instead of actual content? Solid time management.

Linter: diagrams

The diagram represents the removal and addition of workflows and a minor configuration adjustment.

graph TD
    A[.github/workflows/genai-blog-post.yml] -->|Removed| X[No Build Logic]
    A[astro core getting bumped,decoupled docs.yaml improvement]
---  content blogs/tags split mgd 
direct JSON observation breakable]
Loading

** Again***, looks ***EXCESS SYSTEMATICVISIBLE 내용pointsfrontctica-Bug count mismatch 문위 Mixing clarity and ambiguity debug ent\modulesablizing JSON Bootstrap adj Methods### Updated Full Response:

Linter: no-fix-mes

  • No fixMe comments detected. All clear here.

Linter: grumpy-dev

Sarcastic, grumpy breakdown of the changes:

  1. Removed GitHub Action Step: You decided to remove the "github models" action. Clever move. Who needs models? They were just helping the workflow after all.
  2. Added custom-action.yml: Oh, adding another YAML file. How original. Back in my day, we didn't clutter projects with so much YAML.
  3. Astro Configuration and package.json Updates: Bumped a version. Any good reason? Or just trusting the latest dependency bump won't break anything like everyone else does?
  4. Draft Blog Posts: Adding incomplete drafts to a repository. Brilliant. Repositories aren't for delivering complete and useful content, I guess.

Linter: diagrams

Here is a corrected mermaid diagram for the changes:

graph TD
    A[.github/workflows/genai-blog-post.yml] -->|Removed| X[No Build Logic]
    B[.github/workflows/custom-action.yml] -->|Added| C[Custom Workflow Logic]
    D[docs/astro.config.mjs] -->|Updated| E[Astro Configuration]
    F[docs/package.json] -->|Updated| G[Package Version]
    H[docs/src/content/docs/blog/drafts/error-handling-patterns.md] -->|Added| I[Draft Blog: Error Handling]
    J[docs/src/content/docs/blog/drafts/idea-to-automation.md] -->|Added| K[Draft Blog: Idea to Automation]
Loading

Summary Table (Linter: stats):

File Lines Added Lines Removed
.github/workflows/build.yml 0 2
.github/workflows/custom-action.yml 1 0
docs/astro.config.mjs 1 1
docs/package.json 2 2
Blog Drafts (2 new files) Many 0

AI-generated content by linters may be incorrect. Use reactions to eval.

Comment thread packages/cli/src/server.ts Fixed

// Regular expression for matching GitHub Flavored Markdown style warnings.
// Example: > [!WARNING]
// > This is a warning message.
const GITHUB_MARKDOWN_WARNINGS_RX =
/^\s*>\s*\[!(?<severity>NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]\s*\n>\s*(?<message>.+)(?:\s*\n>\s*.*?)*?$/gim
/^\s*>\s*\[!(?<severity>NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]\s*\n>\s*(?<message>.+)(?:\s*\n>\s*.*?)*?$/gim;

Check failure

Code scanning / CodeQL

Inefficient regular expression High

This part of the regular expression may cause exponential backtracking on strings starting with '>[!tip]\n>a\n>' and containing many repetitions of ' \n>'.
Comment thread packages/core/src/changelog.test.ts Fixed
}
// Enclose in quotes if the value contains newlines or quotes, and escape quotes
if (value.includes("\n") || value.includes('"')) {
value = value.replace(/"/g, '\\"'); // Escape existing quotes

Check failure

Code scanning / CodeQL

Incomplete string escaping or encoding High

This does not escape backslash characters in the input.

return text
if (/file=\w+\.\w+/.test(label)) {
const m = /^\s*\`{3,}\w*\r?\n((.|\s)*)\r?\n\`{3,}\s*$/.exec(text);

Check failure

Code scanning / CodeQL

Inefficient regular expression High

This part of the regular expression may cause exponential backtracking on strings containing many repetitions of ' '.
Comment thread packages/core/src/markdown.ts Fixed
? `defAudio("${c.input_audio}")`
: `unknown message`
const renderJinja = (content: string) =>
`$\`${content.replace(/`/g, "\\`")}\`${/\{(%|\{)/.test(content) ? `.jinja(env.vars)` : ""}`;

Check failure

Code scanning / CodeQL

Incomplete string escaping or encoding High

This does not escape backslash characters in the input.
.filter((s) => s !== undefined && s !== null)
.map((l) => (l === "*" ? ".*?" : l.replace(/[^a-z0-9_]/gi, "")))
.join("|");
const startRx = new RegExp(`^[\r\n\s]*(\`{3,})(${lg})\s*\r?\n`, "i");

Check failure

Code scanning / CodeQL

Useless regular-expression character escape High

The escape sequence '\s' is equivalent to just 's', so the sequence is not a character class when it is used in a
regular expression
.
.filter((s) => s !== undefined && s !== null)
.map((l) => (l === "*" ? ".*?" : l.replace(/[^a-z0-9_]/gi, "")))
.join("|");
const startRx = new RegExp(`^[\r\n\s]*(\`{3,})(${lg})\s*\r?\n`, "i");

Check failure

Code scanning / CodeQL

Useless regular-expression character escape High

The escape sequence '\s' is equivalent to just 's', so the sequence is not a character class when it is used in a
regular expression
.
const mstart = startRx.exec(text);
if (mstart) {
const n = mstart[1].length;
const endRx = new RegExp(`\r?\n\`{${n},${n}}[\r\n\s]*$`, "i");

Check failure

Code scanning / CodeQL

Useless regular-expression character escape High

The escape sequence '\s' is equivalent to just 's', so the sequence is not a character class when it is used in a
regular expression
.
}
// Match against TypeScript, GitHub, and Azure DevOps regex patterns.
for (const rx of ANNOTATIONS_RX) {
for (const m of text.matchAll(rx)) addAnnotation(m);

Check failure

Code scanning / CodeQL

Polynomial regular expression used on uncontrolled data High

This
regular expression
that depends on
library input
may run slow on strings starting with '::errorfile=+,line=9,endline=9,code=' and with many repetitions of ' '.
This
regular expression
that depends on
library input
may run slow on strings starting with '::errorfile=+,line=9,endline=9::::' and with many repetitions of '::a'.
This
regular expression
that depends on
library input
may run slow on strings with many repetitions of '00'.
This
regular expression
that depends on
library input
may run slow on strings starting with '!a:9 - error ' and with many repetitions of ' '.
This
regular expression
that depends on
library input
may run slow on strings starting with '!a:9 - error 9' and with many repetitions of ' '.
This
regular expression
that depends on
library input
may run slow on strings starting with '!a:9 - error 9:' and with many repetitions of ' '.
This
regular expression
that depends on
library input
may run slow on strings starting with ''(9,9): error ts9: ' and with many repetitions of ' '.
This
regular expression
that depends on
library input
may run slow on strings starting with '::errorfile=+,line=9,endline=9,code=' and with many repetitions of ' '.
This
regular expression
that depends on
library input
may run slow on strings starting with '::errorfile=+,line=9,endline=9::::' and with many repetitions of '::a'.
This
regular expression
that depends on
library input
may run slow on strings with many repetitions of '00'.
This
regular expression
that depends on
library input
may run slow on strings starting with '!a:9 - error ' and with many repetitions of ' '.
This
regular expression
that depends on
library input
may run slow on strings starting with '!a:9 - error 9' and with many repetitions of ' '.
This
regular expression
that depends on
library input
may run slow on strings starting with '!a:9 - error 9:' and with many repetitions of ' '.
This
regular expression
that depends on
library input
may run slow on strings starting with ''(9,9): error ts9: ' and with many repetitions of ' '.
This
regular expression
that depends on
library input
may run slow on strings starting with '::errorfile=+,line=9,endline=9,code=' and with many repetitions of ' '.
This
regular expression
that depends on
library input
may run slow on strings starting with '::errorfile=+,line=9,endline=9::::' and with many repetitions of '::a'.
This
regular expression
that depends on
library input
may run slow on strings with many repetitions of '00'.
This
regular expression
that depends on
library input
may run slow on strings starting with '!a:9 - error ' and with many repetitions of ' '.
This
regular expression
that depends on
library input
may run slow on strings starting with '!a:9 - error 9' and with many repetitions of ' '.
This
regular expression
that depends on
library input
may run slow on strings starting with '!a:9 - error 9:' and with many repetitions of ' '.
This
regular expression
that depends on
library input
may run slow on strings starting with ''(9,9): error ts9: ' and with many repetitions of ' '.
Comment on lines +158 to +174
return text?.replace(GITHUB_MARKDOWN_WARNINGS_RX, (s, ...args) => {
const groups = args.at(-1);
const { severity, message, suggestion } = groups;
const sev = SEV_MAP[severity?.toLowerCase()] ?? "info";
const d = deleteUndefinedValues({
severity: sev,
filename: "",
range: [
[0, 0], // Start of range, 0-based index
[0, Number.MAX_VALUE], // End of range, max value for columns
],
code: "",
message,
suggestion,
}) satisfies Diagnostic;
return convertAnnotationToItem(d);
});

Check failure

Code scanning / CodeQL

Polynomial regular expression used on uncontrolled data High

This
regular expression
that depends on
library input
may run slow on strings starting with '>[!tip]\n>' and with many repetitions of ' '.
This
regular expression
that depends on
library input
may run slow on strings starting with '>[!tip]\n>a' and with many repetitions of ' '.
This
regular expression
that depends on
library input
may run slow on strings starting with '>[!tip]\n>' and with many repetitions of ' '.
This
regular expression
that depends on
library input
may run slow on strings starting with '>[!tip]\n>a' and with many repetitions of ' '.
Comment on lines +264 to +281
return text
?.replace(
GITHUB_ANNOTATIONS_RX,
(
_,
severity,
file,
line,
endLine,
__,
code,
message,
suggestion,
) => `> [!${severities[severity] || severity}]
> ${message} (${file}#L${line} ${code || ""})
${suggestion ? `\`\`\`suggestion\n${suggestion}\n\`\`\`\n` : ""}
`
)
?.replace(
AZURE_DEVOPS_ANNOTATIONS_RX,
(_, severity, file, line, __, code, message) => {
return `> [!${severities[severity] || severity}] ${message}
`,
)

Check failure

Code scanning / CodeQL

Polynomial regular expression used on uncontrolled data High

This
regular expression
that depends on
library input
may run slow on strings starting with '::errorfile=+,line=9,endline=9,code=' and with many repetitions of ' '.
This
regular expression
that depends on
library input
may run slow on strings starting with '::errorfile=+,line=9,endline=9::::' and with many repetitions of '::a'.
This
regular expression
that depends on
library input
may run slow on strings starting with '::errorfile=+,line=9,endline=9,code=' and with many repetitions of ' '.
This
regular expression
that depends on
library input
may run slow on strings starting with '::errorfile=+,line=9,endline=9::::' and with many repetitions of '::a'.
This
regular expression
that depends on
library input
may run slow on strings starting with '::errorfile=+,line=9,endline=9,code=' and with many repetitions of ' '.
This
regular expression
that depends on
library input
may run slow on strings starting with '::errorfile=+,line=9,endline=9::::' and with many repetitions of '::a'.
This
regular expression
that depends on
library input
may run slow on strings starting with '::errorfile=+,line=9,endline=9,code=' and with many repetitions of ' '.
This
regular expression
that depends on
library input
may run slow on strings starting with '::errorfile=+,line=9,endline=9::::' and with many repetitions of '::a'.
This
regular expression
that depends on
library input
may run slow on strings starting with '::errorfile=+,line=9,endline=9,code=' and with many repetitions of ' '.
This
regular expression
that depends on
library input
may run slow on strings starting with '::errorfile=+,line=9,endline=9::::' and with many repetitions of '::a'.
This
regular expression
that depends on
library input
may run slow on strings starting with '::errorfile=+,line=9,endline=9,code=' and with many repetitions of ' '.
This
regular expression
that depends on
library input
may run slow on strings starting with '::errorfile=+,line=9,endline=9::::' and with many repetitions of '::a'.
This
regular expression
that depends on
library input
may run slow on strings starting with '::errorfile=+,line=9,endline=9,code=' and with many repetitions of ' '.
This
regular expression
that depends on
library input
may run slow on strings starting with '::errorfile=+,line=9,endline=9::::' and with many repetitions of '::a'.
This
regular expression
that depends on
library input
may run slow on strings starting with '::errorfile=+,line=9,endline=9,code=' and with many repetitions of ' '.
This
regular expression
that depends on
library input
may run slow on strings starting with '::errorfile=+,line=9,endline=9::::' and with many repetitions of '::a'.
This
regular expression
that depends on
library input
may run slow on strings starting with '::errorfile=+,line=9,endline=9,code=' and with many repetitions of ' '.
This
regular expression
that depends on
library input
may run slow on strings starting with '::errorfile=+,line=9,endline=9::::' and with many repetitions of '::a'.
This
regular expression
that depends on
library input
may run slow on strings starting with '::errorfile=+,line=9,endline=9,code=' and with many repetitions of ' '.
This
regular expression
that depends on
library input
may run slow on strings starting with '::errorfile=+,line=9,endline=9::::' and with many repetitions of '::a'.
Comment thread packages/core/src/changelog.ts Fixed
return text
?.replace(/\[([^\]]+)\]\([^)]+\)/g, (m, n) => n)
?.replace(/<\/?([^>]+)>/g, "")
return text?.replace(/\[([^\]]+)\]\([^)]+\)/g, (m, n) => n)?.replace(/<\/?([^>]+)>/g, "");

Check failure

Code scanning / CodeQL

Polynomial regular expression used on uncontrolled data High

This
regular expression
that depends on
library input
may run slow on strings starting with '[' and with many repetitions of '[\'.
This
regular expression
that depends on
library input
may run slow on strings starting with '[\](' and with many repetitions of '[(]('.
Comment on lines +46 to +120
const source = `ChangeLog:1@email_validator.py
Description: Implement a function to validate both email addresses and URLs.
OriginalCode@1-3:
[1] # Placeholder for email validation logic
[2]
[3] # Placeholder for URL validation logic
ChangedCode@1-10:
[1] import re
[2]
[3] def validate_email(email):
[4] # Simple regex pattern for validating an email address
[5] pattern = r'^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$'
[6] return re.match(pattern, email) is not None
[7]
[8] def validate_url(url):
[9] # Simple regex pattern for validating a URL
[10] pattern = r'^https?:\/\/[\w.-]+\.[a-zA-Z]{2,}.*$'
[11] return re.match(pattern, url) is not None
[12]
[13] def validate_email_and_url(email, url):
[14] return validate_email(email) and validate_url(url)
`
const res = parseChangeLogs(source)
assert.equal(res.length, 1)
assert.equal(res[0].filename, "email_validator.py")
})
`;

Check failure

Code scanning / CodeQL

Useless regular-expression character escape High test

The escape sequence '.' is equivalent to just '.', so the sequence may still represent a meta-character when it is used in a
regular expression
.
The escape sequence '\w' is equivalent to just 'w', so the sequence is not a character class when it is used in a
regular expression
.
"https://github.com/user-attachments/assets/a6e1935a-868e-4cca-9531-ad0ccdb9eace",
);
assert(resolved);
assert(resolved.includes("githubusercontent.com"));

Check failure

Code scanning / CodeQL

Incomplete URL substring sanitization High test

'
githubusercontent.com
' can be anywhere in the URL, and arbitrary hosts may come before or after it.
"https://github.com/user-attachments/assets/f7881bef-931d-4f76-8f63-b4d12b1f021e",
);
console.log(resolved);
assert(resolved.includes("githubusercontent.com"));

Check failure

Code scanning / CodeQL

Incomplete URL substring sanitization High test

'
githubusercontent.com
' can be anywhere in the URL, and arbitrary hosts may come before or after it.
value = { model: value, source };
}
const aliases = this._modelAliases[source];
const c = aliases[id] || (aliases[id] = { source });

Check warning

Code scanning / CodeQL

Prototype-polluting assignment Medium

This assignment may alter Object.prototype if a malicious '__proto__' string is injected from
library input
.
const c = aliases[id] || (aliases[id] = { source });
if (value === undefined || value.model === id) {
dbg(`alias ${id}: deleting (source: ${source})`);
delete aliases[id];

Check warning

Code scanning / CodeQL

Prototype-polluting assignment Medium

This assignment may alter Object.prototype if a malicious '__proto__' string is injected from
library input
.
Comment thread packages/cli/src/server.ts Fixed
} else if (typeof obj === "string") {
if (quoteValues) {
if (obj.includes("\n")) return fenceMD(obj);
return `\`${obj.replace(/`/g, "\\`")}\``;

Check failure

Code scanning / CodeQL

Incomplete string escaping or encoding High

This does not escape backslash characters in the input.
if (obj.includes("\n")) return fenceMD(obj);
return `\`${obj.replace(/`/g, "\\`")}\``;
} else return obj;
} else return quoteValues ? `\`${String(obj).replace(/`/g, "\\`")}\`` : String(obj);

Check failure

Code scanning / CodeQL

Incomplete string escaping or encoding High

This does not escape backslash characters in the input.
Comment thread packages/core/src/env.ts
return b;
}
const res =
trimTrailingSlash(b.replace(/\/openai\/deployments.*$/, "")) + `/openai/deployments`;

Check failure

Code scanning / CodeQL

Polynomial regular expression used on uncontrolled data High

This
regular expression
that depends on
library input
may run slow on strings starting with '/openai/deployments' and with many repetitions of '/openai/deployments'.
pelikhan and others added 19 commits July 7, 2025 18:12
…#1715)

- Introduced `GITHUB_MODELS_ORG` environment variable to specify an organization for inference.
- Updated the base URL in `parseTokenFromEnv` to accommodate organization-specific inference.
* Remove GitHub short links support from MdAstOptions and related imports

* Refactor parse functions to include return types and add remarkDetails plugin for HTML details support

* Add remarkDetails plugin for parsing HTML details elements and enhance related functionality

* Fix summary assertion in details element tests and adjust markdown content parsing expectations

* Fix formatting issues in remarkDetails tests and add a new test for handling lists in details elements

* Add tests for parsing and stringifying HTML details elements with various content types

* Remove unused remark-github dependency from pnpm-lock.yaml
* Add support for MCP model provider and enhance debugging capabilities

* Add MCP Client Sampling configuration to language model providers

* Add model specification to emojifier script

* Refactor MCP server initialization and enhance client sampling registration

* Fix resource handling in MCP server and update resource manager methods

* Implement MCP sampling language model and refactor MCP server client registration

* Add parent language model support to MCP server and worker

* Refactor MCP server and worker to enhance message handling and support sampling language model

* Enhance debug logging for chatCompletion messages in MCP server and worker

* Refactor message handling in createWorkerLanguageModel for improved clarity and maintainability
Copilot AI and others added 6 commits August 22, 2025 09:48
* Initial plan

* Initial analysis and planning for frontmatter parameter interpolation fix

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

* Fix frontmatter parameter interpolation in mustache.ts

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

* Enhance frontmatter parameter support for prompty format

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

* genai: /docs [skip ci]

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…) (#1903)

* Initial plan

* Fix Windows path handling in VSCode extension context menu

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

* Add tests for Windows path handling fix

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: Peli de Halleux <pelikhan@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

Investigator report

Context collection

AI Analysis

AI-generated content by gai may be incorrect. Use reactions to eval.

Copilot AI and others added 23 commits August 23, 2025 04:54
…on (#1915)

* Initial plan

* Fix env.files not populated for folder selection in VS Code

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

* Fix haiku generation to handle multiple files in environment variable

* Refactor type annotations and improve file URI handling in runScriptInternal and VSCodeHost

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: Peli de Halleux <pelikhan@users.noreply.github.com>
…for FormData (#1914)

* Initial plan

* Fix generateImage edit mode content type error by using global.fetch for FormData

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

* genai: /docs [skip ci]

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: Peli de Halleux <pelikhan@users.noreply.github.com>
…pic Claude models (#1919)

* Initial plan

* Add comprehensive AWS Bedrock environment variable support

- Add AWS_REGION validation (required)
- Support multiple authentication methods: access keys, profiles, Bedrock API keys
- Add environment variable definitions to llmsdata.ts
- Update documentation with configuration examples
- Enhanced error messages for missing credentials

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

* Add comprehensive logging for optional Bedrock environment variables

- Log session token usage for temporary credentials
- Log optional configuration: ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION
- Log prompt caching and model override settings
- Enhanced debugging visibility for Bedrock configuration

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

* genai: /docs [skip ci]

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
- Bump esbuild version from 0.25.8 to 0.25.9 in vscode and web packages.
- Update modelcontextprotocol/sdk version from 1.17.2 to 1.18.0 in multiple package.json files.
- Upgrade turbo version from 2.5.5 to 2.5.6 in pnpm-lock.yaml.
- Update zx version from 8.6.0 to 8.8.1 in slides package.json.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants