Skip to content

feat: Also support running a REST proxy#14

Merged
cgwalters merged 1 commit into
mainfrom
agent-rest-proxy-improvements
Feb 10, 2026
Merged

feat: Also support running a REST proxy#14
cgwalters merged 1 commit into
mainfrom
agent-rest-proxy-improvements

Conversation

@cgwalters

@cgwalters cgwalters commented Feb 7, 2026

Copy link
Copy Markdown
Collaborator

It's really convenient and understandable for agents if they can run the
gh CLI directly. We can enable this by setting proxy variables.

Implement this for gitlab and forgejo as well.

@cgwalters cgwalters force-pushed the agent-rest-proxy-improvements branch from e176a3f to c3fc999 Compare February 7, 2026 20:35
@cgwalters cgwalters marked this pull request as ready for review February 7, 2026 22:02
@cgwalters cgwalters changed the title Add github.localhost support and fix scope merging feat: Also support running a REST proxy Feb 7, 2026
@cgwalters cgwalters force-pushed the agent-rest-proxy-improvements branch 2 times, most recently from add4285 to 54c9b58 Compare February 9, 2026 21:25
Add REST API proxy servers that expose service-gator functionality
via HTTP. Each forge runs on its own port to avoid route collisions
(e.g., GitHub and Forgejo both use /repos/*):

  --github-port PORT   GitHub (/api/v3/* + bare paths for gh CLI)
  --gitlab-port PORT   GitLab (/api/v4/*)
  --forgejo-port PORT  Forgejo (/api/v1/*)
  --jira-port PORT     JIRA (/rest/api/2/* + /rest/api/*)
  --rest-server ADDR   Convenience: all four on consecutive ports

Each server carries its ForgeKind and ApiService directly, so
request handling is a simple prefix strip + delegate -- no runtime
route-matching registry needed.

JIRA search requires explicit -p/--project parameters instead of
heuristic JQL parsing for authorization. Projects are validated
against scope permissions, then a project filter is prepended to
the JQL. This separates authorization data from the query language
entirely.

Permission errors use a thiserror-based ServiceError enum so that
map_error_to_status_code and tests can match on typed variants
instead of inspecting error message strings.

Assisted-by: OpenCode (Claude claude-opus-4-6)
@cgwalters cgwalters force-pushed the agent-rest-proxy-improvements branch from 54c9b58 to 9869c61 Compare February 10, 2026 02:31
@cgwalters cgwalters merged commit 9237ec8 into main Feb 10, 2026
1 check passed
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