Skip to content

fix: explain expected reference formats in ref validation errors + omp manifest - #19

Merged
alpertarhan merged 2 commits into
mainfrom
fix/ref-error-hint
Sep 7, 2026
Merged

alpertarhan merged 2 commits into
mainfrom
fix/ref-error-hint

Conversation

@alpertarhan

Copy link
Copy Markdown
Owner

Problem

Agents routinely pass git tags/branches as the ref parameter — most naturally for forgejo_actions, where "runs for tag vX.Y.Z" is a legitimate request served by the separate git_ref parameter. The old error:

invalid Forgejo reference 'v0.21.13-pilot'

gave no hint of the accepted formats, so the model retried variations and burned turns. Observed live: gpt-5.6-sol spiraled on repeated opaque rejections (session log: [forgejo_actions] invalid Forgejo reference 'v0.21.13-pilot').

Changes

1. Self-explanatory errors (runtime.ts, extension.ts) — all three validation sites (resolveRepo, resolveResource, /fj command) now append the accepted formats and route git tags/branches to git_ref:

invalid Forgejo reference 'v0.21.13-pilot' — expected 'server:owner/repo#N' (issue),
'server:owner/repo!N' (pull), 'server:owner/repo' (repo), or
'fj://server/owner/repo/<issue|pull>/<N>'; for git tags/branches use the git_ref parameter

One error is now enough for the model to self-correct. Verified live with gpt-5.6-sol: the previously failing request completes on the next attempt.

2. Manifest (package.json) — pin the pi entry to the extension file and declare the same entry under omp so the oh-my-pi fork's native package discovery finds the toolkit. pi behavior unchanged.

Verification

  • 212/212 tests, tsc --noEmit clean
  • Live retest (omp, gpt-5.6-sol, sentirum/agent-cortex): the exact failing scenario ("list action runs for tag v0.21.13-pilot") now completes without errors

'invalid Forgejo reference' gave the model no way to recover: the ref
parameter is a resource reference (server:owner/repo#N / !N / bare repo /
fj://...), but agents naturally pass git tags or branches there —
especially for forgejo_actions, where filtering runs by a tag is a
legitimate intent with its own git_ref parameter. The retry loop that
follows wastes turns and tokens.

All three validation sites (ForgejoRuntime.resolveRepo, resolveResource,
and the /fj command path) now append the accepted formats and point git
tags/branches at git_ref, so a single error is enough to self-correct.

Observed in a live session: gpt-5.6-sol passed 'v0.21.13-pilot' as ref
and spiraled on repeated opaque rejections; with the hint the same
request completes on the next try.
Pin the pi entry to the extension file instead of the directory, and
declare the same entry under omp so the oh-my-pi fork's native package
discovery picks the toolkit up without the legacy path. pi behavior is
unchanged (same module, explicit path); omp loads it from its own
registry entry.
@alpertarhan
alpertarhan merged commit f904610 into main Sep 7, 2026
3 checks passed
@alpertarhan
alpertarhan deleted the fix/ref-error-hint branch September 7, 2026 11:59
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.

1 participant