Same agent Smaller bill. The tools and infrastructure to get more work from your AI. Fewer tokens. Less compute. Lower cost.
TypeScript agent-harnessagent-harness-engineeringai-engineeringai-observabilityamd-gpuclaude-codeclickhousecodexcoding-agentcoding-agentscursorgenaigpu-monitoringllm-observabilityllmopsnvidia-smiobservabilityopen-sourceopenaiopentelemetry
fix wofklow
amanagarwal042fb72bfc361cf
diff --git a/.github/RELEASING.md b/.github/RELEASING.mdindex 80452709..e90734dd 100644--- a/.github/RELEASING.md+++ b/.github/RELEASING.md@@ -1,6 +1,8 @@# Automated releases-Releases are initiated by pushing one stable SemVer tag from current `main`:+Repository administrators initiate releases manually from **Actions → Release+packages → Run workflow** on `main`. Select a tool and enter a stable SemVer+without a prefix, such as `1.45.0`. The workflow constructs its final tag:```textpy-X.Y.Z@@ -12,7 +14,8 @@ otel-gpu-collector-X.Y.Zopenlit-X.Y.Z```-The tool definitions and version strategies live in `.github/release-tools.json`.+The tool definitions, tag prefixes, and version strategies live in+`.github/release-tools.json`.The `Release packages` workflow generates notes for merged PRs that changedthe selected tool, validates the tool, updates persistent version files whenconfigured, publishes the artifact, and creates the GitHub Release.@@ -38,8 +41,6 @@ Create a `release` Actions environment without human reviewers and configure:- Environment variable `RELEASE_APP_ID`: the GitHub App ID- Environment secret `RELEASE_APP_PRIVATE_KEY`: the App private key- Environment secret `OPENROUTER_API_KEY`: the OpenRouter API key-- Repository variable `RELEASE_APP_SLUG`: the App actor login, including the- `[bot]` suffix shown in Actions events- Optional repository variable `RELEASE_LLM_PRIMARY_MODEL`- Optional repository variable `RELEASE_LLM_FALLBACK_MODEL`@@ -47,32 +48,32 @@ Create a `release` Actions environment without human reviewers and configure:entering the release environment and fails unless it is `admin`. GitHub maystill display the manual **Run workflow** control to non-admin collaborators,but their run stops before checkout, LLM access, version mutation, or publishing.+Configure the `release` environment deployment branch policy to allow only+`main` as an additional safeguard.The model variables default to the reviewed free OpenRouter models in therelease script. Existing npm, PyPI, GHCR, cosign, and Homebrew secrets remainconfigured as required by their publisher workflows.Allow the App to bypass only the `main` rule needed for release-version commits-and the rule preventing updates to a newly created release tag. Restrict release-tag creation to trusted maintainers.+and the rule governing creation of release tags. Completed tags are never moved.## Dry run-Run `Release packages` manually, enter the next existing-format tag, and keep-`dry_run` enabled. A dry run uses current `main`, calls the configured LLM,-runs component validation, and uploads release notes, metadata, and the version-diff without creating a tag, commit, package, image, or GitHub Release.+Run `Release packages` manually, select the tool, enter its next `X.Y.Z`+version, and keep `dry_run` enabled. A dry run uses current `main`, calls the+configured LLM, runs component validation, and uploads release notes, metadata,+and the version diff without creating a tag, commit, package, image, or GitHub+Release. Once the dry run is satisfactory, run it again with `dry_run` disabled.## Failure and recovery-- Before the version commit: fix the failure and rerun the workflow. The- maintainer-created candidate tag remains on its original commit.-- After the version commit but before the tag update: rerun the original run;- the release trailer makes this state resumable.+- Before the version commit: fix the failure and start another manual run.+- After the version commit but before tag creation: rerun with the same tool and+ version; the release trailer makes this state resumable without another commit.- In a publisher or GitHub Release job: use **Re-run failed jobs** so alreadysuccessful package and image jobs are not repeated.-- To abort before mutation, delete the candidate tag. Do not move or delete a- tag after artifacts have been published.+- Do not move or delete a tag after artifacts have been published.The component publisher workflows also support manual dispatch with an exactfinal tag and commit SHA for targeted recovery.diff --git a/.github/scripts/release.py b/.github/scripts/release.pyindex c8f90f63..8755871b 100644--- a/.github/scripts/release.py+++ b/.github/scripts/release.py@@ -88,6 +88,28 @@ def parse_tag(tag: str, config: dict[str, dict[str, Any]]) -> tuple[str, str, direturn key, version, tool+def resolve_release_identity(+ config: dict[str, dict[str, Any]],+ *,+ tag: str | None = None,+ tool_key: str | None = None,+ version: str | None = None,+) -> tuple[str, str, str, dict[str, Any]]:+ if tag:+ if tool_key or version:+ raise ReleaseError("provide either --tag or --tool with --version")+ key, parsed_version, tool = parse_tag(tag, config)+ return tag, key, parsed_version, tool+ if not tool_key or not version:+ raise ReleaseError("--tool and --version are required when --tag is omitted")+ if tool_key not in config:+ raise ReleaseError(f"unsupported release tool: {tool_key}")+ if not SEMVER_RE.fullmatch(version):+ raise ReleaseError(f"version must use stable X.Y.Z SemVer: {version}")+ tool = config[tool_key]+ return f"{tool['tag_prefix']}{version}", tool_key, version, tool++def semver(value: str) -> tuple[int, int, int]:match = SEMVER_RE.fullmatch(value)if not match:@@ -461,22 +483,29 @@ def ensure_package_unpublished(tool: dict[str, Any], version: str) -> None:def prepare(args: argparse.Namespace) -> None:config = load_config(Path(args.config))- tool_key, version, tool = parse_tag(args.tag, config)+ tag, tool_key, version, tool = resolve_release_identity(+ config,+ tag=args.tag,+ tool_key=args.tool,+ version=args.version,+ )source_sha = run("git", "rev-parse", f"{args.source_sha}^{{commit}}")main_sha = run("git", "rev-parse", f"{args.main_ref}^{{commit}}")analysis_sha = source_sharesume_sha: str | None = Nonemain_message = run("git", "show", "-s", "--format=%B", main_sha)main_parents = run("git", "show", "-s", "--format=%P", main_sha).split()- is_release_commit = f"Release-Tag: {args.tag}" in main_message and bool(main_parents)- tag_target = run("git", "rev-parse", f"{args.tag}^{{commit}}", check=False)+ is_release_commit = f"Release-Tag: {tag}" in main_message and bool(main_parents)+ tag_target = run("git", "rev-parse", f"{tag}^{{commit}}", check=False)if source_sha != main_sha:if not is_release_commit or main_parents[0] != source_sha:- raise ReleaseError(f"candidate tag/source {source_sha} must target current main {main_sha}")+ raise ReleaseError(f"release source {source_sha} must target current main {main_sha}")analysis_sha, resume_sha = source_sha, main_sha- elif is_release_commit and tag_target == main_sha:+ elif is_release_commit and (not tag_target or tag_target == main_sha):analysis_sha, resume_sha = main_parents[0], main_sha- previous = previous_tag(args.tag, version, tool, analysis_sha)+ if tag_target and tag_target != main_sha:+ raise ReleaseError(f"release tag {tag} already exists on a different commit")+ previous = previous_tag(tag, version, tool, analysis_sha)previous_version = previous[len(tool["tag_prefix"]):]if tool["version_strategy"] == "npm":already_set = npm_version_already_set(@@ -487,8 +516,8 @@ def prepare(args: argparse.Namespace) -> None:already_set = version_already_set(persisted, previous_version, version, tool["name"])ensure_package_unpublished(tool, version)github = GitHub(args.repository, os.environ["GITHUB_TOKEN"])- if github.get(f"/releases/tags/{args.tag}", allow_404=True) is not None:- raise ReleaseError(f"GitHub Release already exists for {args.tag}")+ if github.get(f"/releases/tags/{tag}", allow_404=True) is not None:+ raise ReleaseError(f"GitHub Release already exists for {tag}")prs, direct = collect_prs(github, previous, analysis_sha, tool["paths"])if not prs:raise ReleaseError(f"no merged PRs changed {tool['name']} since {previous}")@@ -505,7 +534,7 @@ def prepare(args: argparse.Namespace) -> None:output_dir = Path(args.output_dir)output_dir.mkdir(parents=True, exist_ok=True)metadata = {- "tag": args.tag,+ "tag": tag,"tool": tool_key,"tool_name": tool["name"],"publisher": tool["publisher"],@@ -532,7 +561,7 @@ def prepare(args: argparse.Namespace) -> None:handle.write("\n## Direct commits excluded from notes\n\n")for commit in direct:handle.write(f"- `{commit['sha'][:8]}` {commit['subject']}\n")- for key in ("tool", "publisher", "version", "previous_tag", "source_sha", "version_strategy"):+ for key in ("tag", "tool", "publisher", "version", "previous_tag", "source_sha", "version_strategy"):write_output(key, str(metadata[key]))@@ -605,7 +634,6 @@ def bump(args: argparse.Namespace) -> None:f"version bump must change only configured files; allowed={sorted(expected)} actual={sorted(changed)}")write_output("changed", "true" if changed else "false")- write_output("move_tag", "true" if strategy != "none" and not already_set else "false")def main() -> int:@@ -613,7 +641,9 @@ def main() -> int:parser.add_argument("--config", default=str(DEFAULT_CONFIG))subparsers = parser.add_subparsers(dest="command", required=True)prepare_parser = subparsers.add_parser("prepare")- prepare_parser.add_argument("--tag", required=True)+ prepare_parser.add_argument("--tag")+ prepare_parser.add_argument("--tool")+ prepare_parser.add_argument("--version")prepare_parser.add_argument("--source-sha", required=True)prepare_parser.add_argument("--main-ref", default="origin/main")prepare_parser.add_argument("--repository", required=True)diff --git a/.github/scripts/test_release.py b/.github/scripts/test_release.pyindex 0b548c0f..f26dd50a 100644--- a/.github/scripts/test_release.py+++ b/.github/scripts/test_release.py@@ -34,6 +34,19 @@ class ReleaseTests(unittest.TestCase):key, version, _ = release.parse_tag(tag, self.config)self.assertEqual((key, version), parsed)+ def test_tool_and_version_construct_release_tag(self):+ tag, key, version, tool = release.resolve_release_identity(+ self.config, tool_key="gpu-collector", version="0.0.8"+ )+ self.assertEqual(tag, "otel-gpu-collector-0.0.8")+ self.assertEqual((key, version, tool["publisher"]), ("gpu-collector", "0.0.8", "gpu-collector"))++ def test_tool_and_version_reject_unknown_tool_or_invalid_version(self):+ with self.assertRaises(release.ReleaseError):+ release.resolve_release_identity(self.config, tool_key="unknown", version="1.2.3")+ with self.assertRaises(release.ReleaseError):+ release.resolve_release_identity(self.config, tool_key="python", version="v1.2.3")+def test_rejects_unstable_or_malformed_tags(self):for tag in ("py-1.2", "py-v1.2.3", "py-1.2.3-rc.1", "unknown-1.2.3", "otel-gpu-collector-trigger.github.action"):with self.subTest(tag=tag), self.assertRaises(release.ReleaseError):diff --git a/.github/workflows/release.yml b/.github/workflows/release.ymlindex 8b16d7cb..ebeb3db6 100644--- a/.github/workflows/release.yml+++ b/.github/workflows/release.yml@@ -1,19 +1,22 @@name: Release packageson:- push:- tags:- - 'py-*.*.*'- - 'ts-*.*.*'- - 'go-*.*.*'- - 'cli-*.*.*'- - 'controller-*.*.*'- - 'otel-gpu-collector-*.*.*'- - 'openlit-*.*.*'workflow_dispatch:inputs:- tag:- description: Existing-format release tag, for example py-1.45.0+ tool:+ description: Package or tool to release+ required: true+ type: choice+ options:+ - python+ - typescript+ - go+ - cli+ - controller+ - gpu-collector+ - openlit+ version:+ description: Stable SemVer without a prefix, for example 1.45.0required: truetype: stringdry_run:@@ -32,7 +35,6 @@ permissions:jobs:authorize:- if: github.event_name != 'push' || github.actor != vars.RELEASE_APP_SLUGruns-on: ubuntu-24.04steps:- name: Require repository administrator@@ -40,7 +42,12 @@ jobs:GH_TOKEN: ${{ github.token }}REPOSITORY: ${{ github.repository }}ACTOR: ${{ github.actor }}+ WORKFLOW_REF: ${{ github.ref }}run: |+ if [ "$WORKFLOW_REF" != refs/heads/main ]; then+ echo "::error::Release packages must be run from main"+ exit 1+ fiPERMISSION=$(gh api "repos/$REPOSITORY/collaborators/$ACTOR/permission" --jq .permission)if [ "$PERMISSION" != admin ]; thenecho "::error::Release packages may only be run by repository administrators"@@ -48,7 +55,6 @@ jobs:fiprepare:- if: github.event_name != 'push' || github.actor != vars.RELEASE_APP_SLUGneeds: authorizeruns-on: ubuntu-24.04environment: release@@ -58,46 +64,23 @@ jobs:version: ${{ steps.prepare.outputs.version }}source_sha: ${{ steps.prepare.outputs.source_sha }}version_strategy: ${{ steps.prepare.outputs.version_strategy }}- tag: ${{ steps.context.outputs.tag }}+ tag: ${{ steps.prepare.outputs.tag }}dry_run: ${{ steps.context.outputs.dry_run }}steps:- name: Resolve release contextid: contextenv:- EVENT_NAME: ${{ github.event_name }}- PUSH_TAG: ${{ github.ref_name }}- INPUT_TAG: ${{ inputs.tag }}INPUT_DRY_RUN: ${{ inputs.dry_run }}- PUSH_SHA: ${{ github.sha }}- RELEASE_APP_SLUG: ${{ vars.RELEASE_APP_SLUG }}run: |- if [ "$EVENT_NAME" = push ]; then- if [ -z "$RELEASE_APP_SLUG" ]; then- echo "::error::RELEASE_APP_SLUG must be configured before tag-triggered releases"- exit 1- fi- RELEASE_TAG=$PUSH_TAG- SOURCE_SHA=$PUSH_SHA- DRY_RUN=false- else- if [ "$INPUT_DRY_RUN" != true ] && [ -z "$RELEASE_APP_SLUG" ]; then- echo "::error::RELEASE_APP_SLUG must be configured before mutating releases"- exit 1- fi- RELEASE_TAG=$INPUT_TAG- SOURCE_SHA=main- DRY_RUN=$INPUT_DRY_RUN- fi{- echo "tag=$RELEASE_TAG"- echo "source_sha=$SOURCE_SHA"- echo "dry_run=$DRY_RUN"+ echo "source_sha=main"+ echo "dry_run=$INPUT_DRY_RUN"} >> "$GITHUB_OUTPUT"- uses: actions/checkout@v7with:fetch-depth: 0- ref: ${{ steps.context.outputs.source_sha }}+ ref: refs/heads/main- name: Fetch current main and tagsrun: git fetch --force origin main:refs/remotes/origin/main '+refs/tags/*:refs/tags/*'@@ -109,12 +92,14 @@ jobs:OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}RELEASE_LLM_PRIMARY_MODEL: ${{ vars.RELEASE_LLM_PRIMARY_MODEL }}RELEASE_LLM_FALLBACK_MODEL: ${{ vars.RELEASE_LLM_FALLBACK_MODEL }}- RELEASE_TAG: ${{ steps.context.outputs.tag }}+ RELEASE_TOOL: ${{ inputs.tool }}+ RELEASE_VERSION: ${{ inputs.version }}SOURCE_SHA: ${{ steps.context.outputs.source_sha }}REPOSITORY: ${{ github.repository }}run: |python3 .github/scripts/release.py prepare \- --tag "$RELEASE_TAG" \+ --tool "$RELEASE_TOOL" \+ --version "$RELEASE_VERSION" \--source-sha "$SOURCE_SHA" \--repository "$REPOSITORY" \--output-dir release-output@@ -304,14 +289,13 @@ jobs:path: release-output/if-no-files-found: error- - name: Commit version and finalize tag+ - name: Commit version and create final tagid: finalenv:DRY_RUN: ${{ needs.prepare.outputs.dry_run }}SOURCE_SHA: ${{ needs.prepare.outputs.source_sha }}RELEASE_TAG: ${{ needs.prepare.outputs.tag }}VERSION_CHANGED: ${{ steps.version.outputs.changed }}- MOVE_TAG: ${{ steps.version.outputs.move_tag }}run: |if [ "$DRY_RUN" = true ]; thenecho "release_sha=$SOURCE_SHA" >> "$GITHUB_OUTPUT"@@ -332,18 +316,19 @@ jobs:git commit -m "chore(release): $RELEASE_TAG" -m "Release-Tag: $RELEASE_TAG"RELEASE_SHA=$(git rev-parse HEAD)git push origin "$RELEASE_SHA:refs/heads/main"- git tag --force "$RELEASE_TAG" "$RELEASE_SHA"- git push --force origin "refs/tags/$RELEASE_TAG"- elif [ "$MOVE_TAG" = true ]; then- RELEASE_SHA=$SOURCE_SHA- git tag --force "$RELEASE_TAG" "$RELEASE_SHA"- git push --force origin "refs/tags/$RELEASE_TAG"elseRELEASE_SHA=$SOURCE_SHA- if [ "$(git rev-parse "${RELEASE_TAG}^{commit}")" != "$RELEASE_SHA" ]; then- echo "::error::versionless release tag moved during preparation"+ fi++ EXISTING_TAG_SHA=$(git rev-parse "${RELEASE_TAG}^{commit}" 2>/dev/null || true)+ if [ -n "$EXISTING_TAG_SHA" ]; then+ if [ "$EXISTING_TAG_SHA" != "$RELEASE_SHA" ]; then+ echo "::error::release tag already exists on a different commit"exit 1fi+ else+ git tag "$RELEASE_TAG" "$RELEASE_SHA"+ git push origin "refs/tags/$RELEASE_TAG"fiecho "release_sha=$RELEASE_SHA" >> "$GITHUB_OUTPUT"