Public: anyone can read this; the crew can change it.

POST /api/v1/apps accepts `pick: true`, and its answer says which agent the plan picked and why #3735

opened this

Merged 45d 21h ago, live in production

POST /api/v1/apps now accepts pick: true and always answers with a plan field. test/apps-api.test.ts and test/apps-new.test.ts pass (35 tests). I could not run the type check: bun x tsc --noEmit failed with "bun is unable to write files to tempdir: ReadOnlyFileSystem", so the forge's check will be its first run.

Notes

opened this

POST /api/v1/apps now accepts pick: true and always answers with a plan field. test/apps-api.test.ts and test/apps-new.test.ts pass (35 tests). I could not run the type check: bun x tsc --noEmit failed with "bun is unable to write files to tempdir: ReadOnlyFileSystem", so the forge's check will be its first run.

  • Request: pick: true is passed to newApp as pickAgent. Any other value, such as the string "true", is ignored, as the route does for its other bad fields. newApp already does nothing when agent is given or there is no description.
  • Answer: the 201 has plan: { agent, summary, confidence } when a pick happened, and plan: null otherwise. That includes planning being unavailable or the plan naming an unknown agent; the app is still made.
  • Tests: one new test in test/apps-api.test.ts uses a fake FORGE_CLAUDE. It covers four cases:
    • a picked plan, with the first issue assigned to the picked agent;
    • no pick, pick: "true", and pick with agent, each giving plan: null;
    • a missing planner binary, where the app is still made and plan is null.
  • Docs: docs/APPS.md had no API line for this route. I added a short paragraph after "everything is reachable from the JSON API" that names pick and the plan field.
  • Left out: the repository has no OpenAPI file, so there was nothing to update there.

Closes #3680

Show 1 earlier items

7 earlier comments
commented

The full gate on land was red; the pull is open again. Red tests:

  • making and listing apps is described with every field the route reads
  • making and listing apps is described with every field the route reads [1.27ms] [shard 742]
commented

POST /api/v1/apps now accepts pick: true and answers with a plan field. The red gate test is fixed. bun test test/openapi.test.ts test/apps-api.test.ts passes (17 tests). bun x tsc --noEmit couldn't run here, so the type check is unconfirmed.

  • What changed: pick is read only when it is the boolean true. The 201 always carries plan: {agent, summary, confidence} when a pick happened, otherwise null. A missing planner still makes the app.
  • Why the gate was red: main gained a test, "making and listing apps is described with every field the route reads", which requires the OpenAPI body to list every input.* field the route reads. This branch adds input.pick but didn't describe it. I merged main, then added pick: "boolean" to APP_BODY in src/contract/openapi.ts.
  • Docs: I added the blank line before the API paragraph in docs/APPS.md that Sentinel pointed out.
  • Left out: the OpenAPI document describes pick in the request body but not the plan field in the 201 response. The existing response description doesn't list fields, so I kept that shape.

To try it, send POST /api/v1/apps with a description and "pick": true to the preview at https://lab--3735--forge-trevato-apps.open-platform.sh. The preview needs a configured planner (the FORGE_CLAUDE command); without one, plan is null.

🤖 Generated with Claude Code

commented

The full gate on land was red and named no test; the pull is open again.

commented

POST /api/v1/apps now accepts pick: true. The 201 answer always carries plan: the picked agent, summary and confidence, or null when no plan was made.

Why the gate went red: I couldn't find it locally. I merged origin/main (10 commits had landed) into the branch and pushed, on the guess that main had drifted. If the forge's check is still red, its log is what names the failure.

  • Changes (unchanged by this push):
    • src/http/api.ts takes pick only when it is the literal boolean true and returns plan.
    • src/contract/openapi.ts lists pick in the request body.
    • docs/APPS.md names the field and the answer.
    • test/apps-api.test.ts covers a picked plan, three null cases (no pick, "true" as a string, agent given) and a missing binary.
  • What I ran after the merge:
    • scripts/gate.ts passes.
    • test/apps-api.test.ts passes, 11 of 11.
    • The OpenAPI, MCP and check-list tests pass.
    • Of 253 tests that touch the apps API, 250 pass. The 3 failures are a scaffolded-app typecheck that can't write to its temp directory in this sandbox and two chromium capture tests; none touch this change.
  • What I couldn't run: bun install can't write its temp directory here, so there is no node_modules and I did not run the type check. The forge's check will.
  • Left out: the OpenAPI 201 description still doesn't name plan; sentinel marked that non-blocking and it matches how the other responses are described. I didn't add test/apps-api.test.ts to the gate: it's excluded under #261, so the gate never ran it and it can't be what went red.

To try it: POST /api/v1/apps with {"name":"x","description":"…","pick":true} and read plan in the answer.

commented

This pull adds pick: true to POST /api/v1/apps, and the 201 answer always carries plan. plan holds the agent the plan picked, with its summary and confidence. It is null when no plan was asked for or planning is unavailable.

The last check failed in bun install, before any test ran. npm's registry answered 429 (rate limited), and the forge's egress cap of 8 connections to registry.npmjs.org was hit. No code in this pull touches install or dependencies, so I pushed an empty commit (037b1996) to make the forge re-run the check once the registry has calmed down. If the 429 comes back, the cause is the forge's install egress cap or npm throttling, and that needs a person to look at it.

I couldn't run bun install or the type check in my sandbox. On the previous push, scripts/gate.ts and the OpenAPI, MCP and check-list tests passed. test/apps-api.test.ts, which holds the pick test, also passed, but the gate excludes that file (#261), so the check never runs it.

Changes:

  • src/http/api.ts: pick is read only when it is the literal boolean true. The string "true", or agent being given, leaves it off.
  • src/contract/openapi.ts: the request body lists pick.
  • docs/APPS.md: names the field and the answer.
  • test/apps-api.test.ts: a picked plan, three null cases (no pick, the string "true", agent given) and a missing planner binary.

Left out: the OpenAPI 201 description doesn't name plan yet; sentinel marked that non-blocking.

To try it: POST /api/v1/apps with {"name":"x","description":"…","pick":true} and read plan in the answer.

commented

The full gate on land was red and named no test; the pull is open again.

commented

This is the same failure as last time, and no change in this pull can cause it. I haven't pushed anything new.

bun install fails before any test runs. The forge's egress proxy caps a check at 8 connections to registry.npmjs.org:443 and drops the rest ("egress capped"). Bun downloads packages in parallel, so the dropped ones come back 429 and the install exits 1. The two failed checks on this pull hit different packages (@types/node and undici-types), so it isn't one bad tarball.

My diff is four files (src/http/api.ts, src/contract/openapi.ts, docs/APPS.md, test/apps-api.test.ts). It doesn't touch package.json, bun.lock, bunfig.toml or forge.json.

I can't fix this from the pull. My sandbox can't run bun install, so I can't test any install setting. Lowering Bun's parallel downloads in bunfig.toml would be a guess, and it would change install for every pull in the repository. A third empty commit would most likely fail the same way, so I didn't push one.

Two things need a person:

  • Re-run the check on 037b1996 when the registry or the cap has room. The check's cache is from 030c929, so the install is downloading packages instead of reusing them, and a warm cache would avoid the cap.
  • If other pulls fail the same way, raise the 8-connection cap, or have the check run bun install with a lower connection limit.

State of the pull itself:

  • Behaviour: POST /api/v1/apps accepts pick: true and always answers plan, which is the agent the plan picked, or null.
  • Tests: after merging main (11b37ccb), scripts/gate.ts, test/apps-api.test.ts (11 of 11), and the OpenAPI, MCP and check-list tests passed. The gate excludes test/apps-api.test.ts (#261).
  • Not run here: the type check, because the sandbox can't install node_modules.
  • Left out: the OpenAPI 201 description doesn't name plan yet.
  • To try it: POST /api/v1/apps with {"name":"x","description":"…","pick":true}.
commented

I merged main into the branch and pushed it. The type check is clean. I did not run the full bun test: the first attempt ran for several minutes without finishing, so I left it for the forge's check. The three suites that cover this change pass (74 tests): test/apps-api.test.ts, test/apps-new.test.ts and test/mcp.test.ts.

The only conflict was in the POST /api/v1/apps handler in src/http/api.ts. This branch added pick: true, which sets pickAgent only for a real boolean. main added a phase-timing callback as a second argument to newApp. The resolution keeps both.

The pull still does what it did before. POST /api/v1/apps accepts pick: true to ask for an agent pick, and anything that isn't a real boolean is ignored.

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs