Skip to content

Accept vendor-prefixed OpenRouter model IDs in Pi workflows - #77562

Merged
pelikhan merged 10 commits into
mainfrom
copilot/fix-pi-engine-openrouter-example
Nov 15, 2026
Merged

pelikhan merged 10 commits into
mainfrom
copilot/fix-pi-engine-openrouter-example

Conversation

@pelikhan

@pelikhan pelikhan commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

The documented openrouter/anthropic/claude-sonnet-4 configuration was rejected because MAF prohibited slashes within model tokens. The native OpenRouter credential mapping also obscured the explicit route required for sandboxed execution.

  • Identifier grammar: Allow validated, nonempty namespace segments after the provider prefix; retain existing character restrictions.
  • Model matching: Preserve the complete model suffix instead of truncating vendor-prefixed IDs. Wildcards still cannot cross slashes.
  • Routing documentation: Clarify that sandboxed OpenRouter requires an explicit OpenAI-compatible route and exact catalog IDs—vendor namespaces are not inferred.
engine:
  id: pi
  model: openrouter/anthropic/claude-sonnet-4
  model-provider: openai
  env:
    OPENAI_BASE_URL: https://openrouter.ai/api/v1
    OPENAI_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
network:
  allowed: [defaults, openrouter.ai]

Credential-isolation requirements remain unchanged.

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
@pelikhan pelikhan changed the title [WIP] Fix Pi engine OpenRouter example model identifier grammar Accept vendor-prefixed OpenRouter model IDs in Pi workflows Nov 13, 2026
@pelikhan

Copy link
Copy Markdown
Collaborator Author

@SivaKesava1

@pelikhan
pelikhan marked this pull request as ready for review November 14, 2026 14:16
Copilot AI adaptive review requested due to automatic review settings November 14, 2026 14:16
@pelikhan

Copy link
Copy Markdown
Collaborator Author

@rabeckett

@github-actions

github-actions Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~9 AIC · ⌖ ~2 AIC · ⊞ 6.6K · ◷

@github-actions

github-actions Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Code Quality Reviewer completed the code quality review.

PR Code Quality Reviewer

Outcome: reported_action

The agent completed and reported one or more actions. The no-op output is a completion signal, not a claim that no action was taken.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt56 · ~4 AIC · ⌖ ~1 AIC · ◇ ~1 AIC · ⊞ 1.5K · ◷

@github-actions

github-actions Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft.

Design Decision Gate 🏗️

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

🏗️ ADR gate enforced by Design Decision Gate 🏗️ · pi · routed: haiku55 xhigh · ~1 AIC · ⌖ ~2 AIC · ◇ ~1 AIC · ⊞ 8.6K · ◷

@github-actions

github-actions Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Specification Reviewer completed successfully!

Commit pushed: 401aede

Generated by PR Specification Reviewer for #77562 · copilot · gpt56 · ~6 AIC · ⌖ ~2 AIC · ◇ ~1 AIC · ⊞ 1.6K · ◷

@github-actions

github-actions Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

✅ Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

🧪 Test quality analysis by Test Quality Sentinel · copilot · routed: haiku55 xhigh · ~1 AIC · ⌖ ~2 AIC · ◇ ~1 AIC · ⊞ 7.3K · ◷

@github-actions

github-actions Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

✅ Ponytail Reviewer completed successfully!

Ponytail Reviewer

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated by Ponytail Reviewer for #77562 · codex · routed: gpt61 medium · ~4 AIC · ⌖ ~1 AIC · ◇ ~1 AIC · ⊞ 182 · ◷

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed with one medium-severity correctness issue: namespaced glob matching can select the wrong model version because sorting truncates the model suffix. Please preserve the full suffix when extracting version tokens.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~4 AIC · ⌖ ~1 AIC · ⊞ 1.5K
Comment /review to run again

const entryParts = entry.split("/", 2);
if (patternParts.length === 1) {
const patternParts = [pattern.slice(0, pattern.indexOf("/")), pattern.slice(pattern.indexOf("/") + 1)];
const entryParts = [entry.slice(0, entry.indexOf("/")), entry.slice(entry.indexOf("/") + 1)];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Namespaced glob matches now reach this resolver, but the latest-match sort still truncates each entry at the second slash, so every openrouter/anthropic/* candidate is scored from anthropic and the catalog order wins instead of selecting the newest model.

💡 Preserve the full model suffix

Use the substring after the first slash (for example entry.slice(entry.indexOf("/") + 1)) rather than split("/", 2)[1] in both comparator operands, and add a regression test with two versioned namespaced candidates. This keeps alias resolution deterministic and preserves the intended newest-version behavior.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already fixed in 4d01ccd: version sorting preserves the full suffix, with a 4.9-versus-4.10 namespaced regression. The targeted alias tests pass after merging main.

@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

Peek at saved memory (review-history)
{"id":"ldg-318f4ea9-7e4b-44eb-94b6-001514269bcb","parents":[],"payload":{"id":"ldg-9ce73a1d-5983-4170-9bf3-60b912d132b6","operation":"append","value":{"finding_count":1,"head_sha":"f7704b452859598c52a514e69be1548d694b4562","outcome":"findings"}},"sha":"sha256:52bc36176890172a0b657c8b0ead0186f100e69260bee05e89e46c0ef2c823b5","timestamp":"2026-11-14T14:24:10.098Z","type":"ledger_append","version":1}
History

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed PR head f7704b4 against Model Alias Format Specification §4.1, §11, and §12 (v1.3.1). The intentional namespaced-model behavior is supported by the implementation and tests. The specification edit needed versioning, change-log, conformance IDs, and sync-note updates; these were applied in model-alias-specification.md as v1.4.0 and queued to the PR branch in commit 838eebd. No implementation or test changes were made by the review. Static review only; tests were not run.

Generated by PR Specification Reviewer for #77562 · copilot · gpt50 · ~6 AIC · ⌖ ~2 AIC · ⊞ 1.6K
Comment /review-specs to run again

@pelikhan

Copy link
Copy Markdown
Collaborator Author

@copilot resolve the merge conflicts on this branch.

@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

Peek at saved memory (spec-review-history)
{"id":"ldg-2bda74a8-87f5-4107-bdaf-97788a16779e","parents":[],"payload":{"id":"ldg-5a152194-a757-408f-a119-2830d67280cb","operation":"append","value":{"finding_count":1,"head_sha":"f7704b452859598c52a514e69be1548d694b4562","outcome":"updated"}},"sha":"sha256:0df7bc8d88295d902bbcc5f745046833375016ed13ea720ac198aa349b1ed83a","timestamp":"2026-11-14T14:26:58.929Z","type":"ledger_append","version":1}
History

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Existing helper tests fail, and namespaced model IDs still break Pi sub-agent startup and live alias resolution.

3 open issues
What changed in this PR

This PR addresses #77514 by allowing vendor-prefixed OpenRouter model IDs in gh-aw and clarifying the explicit route required for sandboxed Pi workflows.

Changes:

  • Allow validated, nonempty namespace segments in exact model IDs.
  • Preserve complete model suffixes during matching while keeping wildcards from crossing slashes.
  • Add regression coverage and document exact catalog IDs and credential-isolated routing.
File Description
pkg/​workflow/​pi_engine_config_compilation_test.go Tests OpenRouter compilation and explicit route requirements.
pkg/​workflow/​model_identifier.go Allows slash-separated model namespaces.
pkg/​workflow/​model_alias_validation_test.go Tests valid and invalid namespaced identifiers.
docs/​src/​content/​docs/​specs/​model-alias-specification.md Updates the identifier grammar and namespace rules.
docs/​src/​content/​docs/​reference/​engines/​pi.md Clarifies OpenRouter catalog IDs and sandbox routing.
actions/​setup/​js/​resolve_model_alias.test.cjs Tests namespaced matching and wildcard boundaries.
actions/​setup/​js/​resolve_model_alias.cjs Preserves the full model suffix during matching.
actions/​setup/​js/​pi_models_json.test.cjs Tests exact OpenRouter IDs through the OpenAI gateway.

Review effort: Balanced (dynamic)

func firstForbiddenCharInModelToken(s string) rune {
for _, r := range s {
if !isAlpha(r) && !isDigit(r) && r != '_' && r != '.' && r != '-' {
if !isAlpha(r) && !isDigit(r) && r != '_' && r != '.' && r != '/' && r != '-' {
expect(globMatch("openrouter/anthropic/claude-sonnet-4", "openrouter/anthropic/claude-sonnet-4")).toBe(true);
expect(globMatch("openrouter/anthropic/claude-sonnet-4", "openrouter/anthropic/claude-opus-4")).toBe(false);
expect(globMatch("openrouter/*", "openrouter/anthropic/claude-sonnet-4")).toBe(false);
expect(resolveModelAlias("sonnet", { sonnet: ["openrouter/anthropic/claude-sonnet-4"] }, ["openrouter/anthropic/claude-opus-4", "openrouter/anthropic/claude-sonnet-4"])).toBe("openrouter/anthropic/claude-sonnet-4");
// model-token: model-char segments separated by "."; each segment starts with ALPHA or DIGIT
reModelToken = regexp.MustCompile(`^[A-Za-z0-9][A-Za-z0-9_-]*(\.[A-Za-z0-9][A-Za-z0-9_-]*)*$`)
// model-token: nonempty slash-separated segments; each dot-separated component starts with ALPHA or DIGIT
reModelToken = regexp.MustCompile(`^[A-Za-z0-9][A-Za-z0-9_-]*([./][A-Za-z0-9][A-Za-z0-9_-]*)*$`)

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skills-Based Review 🧠

Applied /tdd and /grill-with-docs. Requesting changes because namespaced policy rules fail open.

📋 Key Themes & Highlights

Key Themes

  • Fail-open policy rules: splitModelPolicyRule (pkg/workflow/model_routing.go, unchanged) uses LastIndex, so namespaced models.blocked rules are silently ignored once the grammar admits /.
  • Test gap: the new tests cover parsing and exact matching, not policy enforcement or the wildcard boundary.

Positive Highlights

  • ✅ globMatch now slices on the first /. * maps to [^/]*, so openrouter/* no longer matches nested namespaces.
  • ✅ Grammar and error text are updated together with the spec and pi.md.
  • ✅ The OpenRouter compile test checks the exact GH_AW_PI_MODEL value.

Limits

  • Go rejects namespaced glob tokens at parse time, so the selectLatestGlobMatch split in the JS file is not reachable from compiled workflows and was not flagged.
  • Full Go and vitest suites were not run; targeted probes only.

@copilot please address the review comments above.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~9 AIC · ⌖ ~2 AIC · ⊞ 6.6K
Comment /matt to run again

// model-token: model-char segments separated by "."; each segment starts with ALPHA or DIGIT
reModelToken = regexp.MustCompile(`^[A-Za-z0-9][A-Za-z0-9_-]*(\.[A-Za-z0-9][A-Za-z0-9_-]*)*$`)
// model-token: nonempty slash-separated segments; each dot-separated component starts with ALPHA or DIGIT
reModelToken = regexp.MustCompile(`^[A-Za-z0-9][A-Za-z0-9_-]*([./][A-Za-z0-9][A-Za-z0-9_-]*)*$`)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[/grill-with-docs] This grammar now admits namespaced model tokens, but the policy path does not follow. splitModelPolicyRule in pkg/workflow/model_routing.go (unchanged here) uses strings.LastIndex, so openrouter/anthropic/claude-opus-4 splits into provider openrouter/anthropic. qualifiedModelPolicyRule then returns ok=false, and a namespaced models.blocked rule is silently ignored. That fails open.

💡 Suggested fix

Split on the first /, as modelRoutingCandidateNamespace already does. The provider is the first segment and the model is the rest. Bare rules (no /) must still apply to every provider.

@copilot please address this.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already fixed in 4d01ccd: policy rules split on the first slash, preserving the complete model namespace. Targeted namespaced policy tests pass after merging main.

assert.Equal(t, "claude-opus-4.5", p.ModelToken)
}

func TestParseModelIdentifier_NamespacedModel(t *testing.T) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[/tdd] TestParseModelIdentifier_NamespacedModel only checks parsing. It does not exercise policy matching, so the fail-open above passes CI.

💡 Suggested test

Write these red tests first:

  • models.blocked: ["openrouter/anthropic/claude-opus-4"] must exclude the candidate openrouter/anthropic/claude-opus-4.
  • models.allowed: ["openrouter/*"] must not match openrouter/anthropic/claude-opus-4, because * does not cross /.

@copilot please address this.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Covered in 4d01ccd and 6fea037: exact namespaced blocked rules exclude the candidate, and openrouter/* does not authorize nested namespaces. Both regression tests pass.

expect(matches).toBe("copilot/claude-sonnet-4.6");
});

it("preserves the full namespaced model token when matching", () => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[/tdd] The new test covers exact namespaced matching but not the wildcard boundary. Since * maps to [^/]*, add a case asserting globMatch("openrouter/*", "openrouter/anthropic/claude") is false, plus a positive openrouter/anthropic/*sonnet* case if not already covered. These lock the rewritten segment logic against regressions.

@copilot please address this.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Covered in 4d01ccd: openrouter/* rejects nested namespaces, while openrouter/anthropic/*sonnet* matches. The targeted JavaScript suite passes.

…-openrouter-example

# Conflicts:
#	docs/src/content/docs/specs/model-alias-specification.md

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>

Copilot AI commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts on this branch.

Resolved the conflict and merged main, preserving both sides’ change-log entries. Merge commit: b4f1dfc84d.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot

🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes.
  2. Review (actions/setup/js/resolve_model_alias.cjs:104): address unresolved feedback - Review comment
  3. Review (pkg/workflow/model_identifier.go:96): address unresolved feedback - Review comment
  4. Review (pkg/workflow/model_alias_validation_test.go:112): address unresolved feedback - Review comment
  5. Review (actions/setup/js/resolve_model_alias.test.cjs:40): address unresolved feedback - Review comment
  6. Fix failing check build-wasm (FAILURE): Check run.

Keeping the changes focused; human review and CI get the final taste test. No merging or CI triggering.

Structured data
{
  "completed_task": 0,
  "head": "b4f1dfc84de934dd328122b302cf57091576101f",
  "kind": "requested",
  "schema_version": "1",
  "state": "fb8a8fb67fba4123532b5951acd24efafc6a350554f72a7b364df778b721dc8b",
  "work": [
    "07a86ee097ca08ae818f3c3e23bc0edc1fcf36458fb6ccd20d42272de366a10d",
    "76845a0049c50dcf66f2707be71f139f2e468a5a6bf0f2a0bf686917737eb9ab",
    "8acb61a077717e3a460018aacdfde96fd489f77606cd36169e2328d9079b75bb",
    "b45dc3930e33923bd2acc2d7960bd68dca75238b6db3b190a8ca378c14a52495",
    "f0ea5c9a97be4fe1ab906cea61b77689a1f4636ad81de2c6ded0e56b27c0ab02"
  ],
  "workflow": "pr-sous-chef"
}

Generated by 👨🍳 PR Sous Chef · pi · routed: haiku55 xhigh · ~2 AIC · ⌖ ~2 AIC · ⊞ 6.9K · ◷
Comment /souschef to run again

…-openrouter-example

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>

Copilot AI commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts on this branch.

Merged the latest main cleanly in 4ee94e5. make merge-main’s pre-merge formatter modified deck.js and aborted, so I reverted that generated formatting change and completed the same merge directly.

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Copilot stopped work on behalf of gh-aw-bot due to an error November 14, 2026 16:06
Copilot AI requested a review from gh-aw-bot November 14, 2026 16:06
@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot

🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes.
  2. Review (actions/setup/js/resolve_model_alias.cjs:104): address unresolved feedback - Review comment
  3. Review (pkg/workflow/model_identifier.go:96): address unresolved feedback - Review comment
  4. Review (pkg/workflow/model_alias_validation_test.go:112): address unresolved feedback - Review comment
  5. Review (actions/setup/js/resolve_model_alias.test.cjs:45): address unresolved feedback - Review comment
  6. Fix failing check JS Tests (shard 3/8) (FAILURE): Check run.

Keeping the changes focused; human review and CI get the final taste test. No merging or CI triggering.

Structured data
{
  "completed_task": 0,
  "head": "4d01ccd8a8714b5320976ef24b59211c65b20b46",
  "kind": "requested",
  "schema_version": "1",
  "state": "618878a545056f804a9c65c7de0241199cf88f21dc27f3470a481585c259e8ce",
  "work": [
    "07a86ee097ca08ae818f3c3e23bc0edc1fcf36458fb6ccd20d42272de366a10d",
    "4abda31131600b8ff4d73bd7f3bf534a014465b854fafd42d5113bf9f4d854ee",
    "76845a0049c50dcf66f2707be71f139f2e468a5a6bf0f2a0bf686917737eb9ab",
    "b45dc3930e33923bd2acc2d7960bd68dca75238b6db3b190a8ca378c14a52495",
    "f0ea5c9a97be4fe1ab906cea61b77689a1f4636ad81de2c6ded0e56b27c0ab02"
  ],
  "workflow": "pr-sous-chef"
}

Generated by 👨🍳 PR Sous Chef · pi · routed: haiku55 xhigh · ~2 AIC · ⌖ ~2 AIC · ⊞ 7K · ◷
Comment /souschef to run again

gh-aw-bot and others added 3 commits November 14, 2026 16:56
…-openrouter-example

# Conflicts:
#	scripts/test-wasm-golden.mjs

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

Copy link
Copy Markdown
Collaborator Author

@copilot resolve the merge conflicts on this branch.

…-openrouter-example

# Conflicts:
#	actions/setup/js/check_workflow_timestamp_api.test.cjs
#	scripts/test-wasm-golden.mjs

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>

Copilot AI commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

@copilot

🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:...

Merged main in 7088627e. Verified and replied to all four linked review fixes. The timestamp/import regression and targeted JavaScript suites pass; the final gate reports unrelated pre-existing lock-file drift.

@copilot resolve the merge conflicts on this branch.

Resolved both conflicts and merged main in 7088627e, preserving the OpenRouter changes. Tests and lint passed; the final gate reports pre-existing lock-file drift. CodeQL timed out.

@pelikhan
pelikhan merged commit 29b0a3f into main Nov 15, 2026
86 checks passed
@pelikhan
pelikhan deleted the copilot/fix-pi-engine-openrouter-example branch November 15, 2026 09:10
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v1.3.0

jansdhillon added a commit to canonical/landscape-client that referenced this pull request Nov 20, 2026
https://warthogs.atlassian.net/browse/LNDENG-5627

Related PRs:
- canonical/landscape-documentation#426 (release-notes-draft workflow
that opens the shared PR)
- canonical/landscape-internal-docs#350 (shared-secret convention)
- canonical/landscape-internal-docs#388 (changelog-bot OpenSpec spec and
design doc)

Spec: openspec/changes/changelog-bot/ in
canonical/landscape-internal-docs (PR #388), with baseline specs under
openspec/specs/changelog-bot/ (own-repo-changelog, shared-release-notes,
shared-infrastructure).

## Summary

Adds a weekly changelog bot, ported from landscape-server. Every
Saturday it collects user-facing conventional commits since the last
release, prepends a new debian/changelog block, bumps the companion
version file, and opens a PR.

Adaptations: maintains debian/changelog for the landscape-client
package; release-point detection uses git describe with --exclude
'import/*' --exclude 'applied/*' because this repo carries gbp import
tags in those namespaces (release tags use a hyphen where the changelog
uses a tilde); the tag anchor is kept because this repo pushes beta tags
during the cycle, so the time-based window is not needed. Next-version
rule: increment ~beta.N within a cycle; after a final or patch release,
start the next YY.MM cycle as YY.MM~beta.1. Bumps UPSTREAM_VERSION and
PYTHON_VERSION in landscape/__init__.py instead of
pyproject.toml/uv.lock, so no protected-files exclusion is needed. PR
titles follow this repo's release convention (build: release <version>
for jammy).

Aligned with the landscape-ui iteration where applicable:
create-pull-request allows only debian/changelog and
landscape/__init__.py; push-to-pull-request-branch allows only docs
release-notes pages. Dedup against the top changelog block handles a
release PR merged before its tag is pushed. Flag-only review (never
edits existing content): fixes for unreleased regressions and
user-facing commits with no (#1234) reference are flagged under a
"Changelog entries to review" heading. Breaking changes are detected via
BREAKING CHANGE: footers, and conventional prefixes are matched
case-insensitively.

## Docs release notes

The bot also writes the Landscape Client section of the shared
release-notes PR in canonical/landscape-documentation. It only pushes
its own section to the existing PR's branch and skips the docs work when
none is open. Docs steps never git fetch; the handler applies the
section-scoped patch to the branch tip and fails on conflict.

## Secrets

- OPENROUTER_API_KEY: pi engine inference (passed as OPENAI_API_KEY with
OPENAI_BASE_URL pinned to `https://openrouter.ai/api/v1`).
- COPILOT_GITHUB_TOKEN: threat detection only. gh-aw's threat-detection
job is hardcoded to the Copilot CLI and pinned to a Copilot-catalog
model (`claude-haiku-5.5`); detection cannot run on OpenRouter
(github/gh-aw#78414), so this token stays solely to keep that job alive.
- LANDSCAPE_CHANGELOG_TOKEN: fine-grained PAT with contents and
pull-requests read/write on this repo and
canonical/landscape-documentation. Backs the whole safe_outputs job
(github/gh-aw#77580 binds it to one credential): the own-repo changelog
PR and the release-notes push. Documented in
canonical/landscape-internal-docs#350.

All three are present in this repo (verified 2026-11-13). Agent egress
is confined by the AWF firewall to the default allowlist; all secret
values feed gh-aw's output-redaction step.

## Engine and pre-merge testing notes

The bot runs on the pi engine with model
`openrouter/deepseek/deepseek-v4.1-flash-1017` and `model-provider:
openai`, using OPENROUTER_API_KEY. The vendored OpenRouter id requires
gh-aw v1.3.0+ (github/gh-aw#77514, fixed by github/gh-aw#77562); the
workflow is compiled with gh-aw v1.3.0. The commit range is computed
against origin/main, and each commit is classified individually in a
per-commit table. The changelog PR branch is created from origin/main,
and the bot never opens a second changelog PR while one is still open.

A PR that introduces a brand-new gh-aw workflow cannot be exercised via
a pull_request trigger before merge: gh-aw's activation job resolves the
workflow file from the base branch (main), where it does not exist yet.
The temporary synchronize trigger used to attempt that has been removed,
along with the empty test commit. The workflow will run on schedule and
via workflow_dispatch after merge.

Post-merge end-to-end verification passed on landscape-server: the
changelog bot ran cleanly on OpenRouter/deepseek in run 43938834931
(https://github.com/canonical/landscape-server/actions/runs/43938834931),
opening a correctly scoped release PR. The temporary pull_request:
synchronize trigger used during that test has been reverted there; the
workflow now runs on schedule and via workflow_dispatch only, matching
the configuration in this PR.

Review fixes in f7107cf address Perfect5th review items: sha256
checksum verification for the Docker Compose download and
actions/setup-node bumped from v4 to v7.

## Latest verification (2026-11-18)

Run
[44280915893](https://github.com/canonical/landscape-server/actions/runs/44280915893)
on landscape-server, on OpenRouter/deepseek with threat detection on the
pinned Copilot model. It opened release PR #1890 with exactly the three
expected files (standalone/debian/changelog, pyproject.toml, uv.lock)
after the previous changelog PR was closed, so the dedup and create
paths are both exercised.

The documentation push failed in safe_outputs: the shared component
checked out the docs repo's default branch, but the release-notes page
exists only on the shared draft PR's branch, so the resulting
create-file patch could not be applied. That is fixed in
canonical/landscape-internal-docs#394 (merged), and this PR now pins the
component to that merge commit d627562c, so the docs push uses the
shared draft PR's branch. The earlier run cited above (43938834931)
predates the shared-component import and the pull-requests: read grant.

Stacked on #467 (OpenSpec store reference).
The shared OpenSpec skills live in the landscape-home repo, not here.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pi engine OpenRouter example is rejected by the model identifier grammar

4 participants