paperclip/packages
Dotta 83243d4b5d
feat(runner): add bounded Codex app-server transport (#12362)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work
> - The first production runner provider is Codex
> - Codex app-server communicates with JSON-RPC over a child process
> - The process boundary needs explicit resource, environment, and
diagnostic limits
> - This pull request adds only the bounded transport layer
> - A later pull request will add the Codex event-mapping driver
> - The benefit is a small reviewable process boundary before provider
behavior is added

## Linked Issues or Issue Description

**Subsystem affected**

`packages/paperclip-runner` Codex transport.

**Problem or motivation**

The runner needs a safe way to start and communicate with Codex
app-server. Unbounded lines, queued notifications, pending requests, and
inherited credentials would make that boundary unsafe.

**Proposed solution**

Add a JSON-RPC process transport with explicit byte and count limits,
sanitized environment construction, process-group metadata,
server-request handling, redacted diagnostics, and deterministic
closure.

**Alternatives considered**

Adding transport and the full Codex driver in one change would create a
much larger review surface. This pull request isolates the child-process
boundary.

**Roadmap alignment**

This supports the Codex-first experimental runner. It does not enable
the runner adapter.

## What Changed

- Added bounded JSON-RPC request and notification queues.
- Added malformed-message and oversized-line fail-closed behavior.
- Added sanitized Codex environment construction.
- Added process-group tracking and deterministic shutdown.
- Added redacted diagnostics and server-request replies.

## Verification

- `pnpm --filter @paperclipai/paperclip-runner test:typescript`
- `pnpm -r typecheck`
- `pnpm build`
- The focused transport test has 6 passing cases.

## Risks

The main risk is child-process cleanup. Tests cover closure, pending
request rejection, queue bounds, process metadata, and malformed input.

## Model Used

OpenAI Codex with GPT-5.6 and repository tool use.

## Checklist

- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have searched GitHub for duplicate or related PRs and linked
them above
- [x] I have either (a) linked existing issues with `Fixes: #` / `Closes
#` / `Refs #` OR (b) described the issue in-PR following the relevant
issue template
- [x] I have not referenced internal/instance-local Paperclip issues or
links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip`
URLs)
- [x] My branch name describes the change (e.g. `docs/...`, `fix/...`)
and contains no internal Paperclip ticket id or instance-derived details
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [ ] All Paperclip CI gates are green
- [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups
- [x] I will address all Greptile and reviewer comments before
requesting merge
2026-08-30 00:07:50 -05:00
..
adapter-utils feat(connections): add self-serve intent runtime (#12345) 2026-08-29 12:08:34 -05:00
adapters feat(connections): add self-serve intent runtime (#12345) 2026-08-29 12:08:34 -05:00
db feat(connections): add managed external MCP connectors (#12346) 2026-08-29 12:08:34 -05:00
google-sheets-mcp-server build(deps-dev): bump typescript from 5.9.3 to 7.0.2 (#11880) 2026-08-25 14:49:05 -07:00
kv-demo-mcp-server build(deps-dev): bump typescript from 5.9.3 to 7.0.2 (#11880) 2026-08-25 14:49:05 -07:00
mcp-server feat(connections): add self-serve intent runtime (#12345) 2026-08-29 12:08:34 -05:00
paperclip-runner feat(runner): add bounded Codex app-server transport (#12362) 2026-08-30 00:07:50 -05:00
plugins feat(connections): add self-serve intent runtime (#12345) 2026-08-29 12:08:34 -05:00
shared feat(runner): project native runs into task threads (#12321) 2026-08-29 19:26:20 -05:00
skills-catalog feat(apps): add secure remote MCP and PostHog setup (#12339) 2026-08-29 12:08:32 -05:00
tailscale-https-broker build(deps-dev): bump typescript from 5.9.3 to 7.0.2 (#11880) 2026-08-25 14:49:05 -07:00
teams-catalog fix(build): enforce Node 24 across Paperclip (#11792) 2026-08-21 10:17:52 -07:00