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

`forge tell "words"` tells the crew from your shell, about the repository of the folder you are in #7460

Parked opened this
Closed without merging

forge tell now tells the crew from your shell. The new CLI tests and the existing forge asks tests pass, and bun x tsc --noEmit is clean. I did not run the full suite or scripts/fast.ts, and I have not run it against a real workbench.

Notes

stopped parked by the crew deploy 09f72e8

opened this

forge tell <words…> now tells the crew from your shell. The new CLI tests and the existing forge asks tests pass, and bun x tsc --noEmit is clean. I did not run the full suite or scripts/fast.ts, and I have not run it against a real workbench.

  • What it does: it posts {app, text} to POST /api/v1/feed/tells through a new tell method in src/cli/api.ts. On success it prints told owner/name: issue #N <address> and exits 0.
  • Which repository:
    • It comes from the folder's origin remote when that is an http(s) URL on the configured workbench. A .git suffix, credentials and a path prefix on the workbench URL are handled.
    • --repo owner/name overrides it.
    • If origin points anywhere else, including ssh remotes, it asks for --repo and exits 2.
  • Exit codes:
    • Empty words, words over 2000 characters, a bad --repo, or an origin that isn't on the workbench exit 2 with usage.
    • Not logged in exits 3, as does a 401 from the API.
    • Any other refusal prints the API's words and exits 1.
  • Reachability: forge help lists the command, and I added a line to the README's CLI section.
  • Tests: test/cli-tell.test.ts runs the CLI against a fake API. It checks the request body, the printed address, each exit code, --repo, the help line and the remote parsing.
  • Left out: variants and from are not exposed, and ssh remotes are not parsed.

To try it, run forge login <url>, then cd into a clone from that workbench and run forge tell "make the header smaller".

Closes #7352

7 earlier comments · 3 events
commented

forge tell <words…> now tells the crew from your shell. The new CLI tests and the existing forge asks tests pass, and bun x tsc --noEmit is clean. I did not run the full suite or scripts/fast.ts, and I have not run it against a real workbench.

  • What it does: it posts {app, text} to POST /api/v1/feed/tells through a new tell method in src/cli/api.ts. On success it prints told owner/name: issue #N <address> and exits 0.
  • Which repository:
    • It comes from the folder's origin remote when that is an http(s) URL on the configured workbench. A .git suffix, credentials and a path prefix on the workbench URL are handled.
    • --repo owner/name overrides it.
    • If origin points anywhere else, including ssh remotes, it asks for --repo and exits 2.
  • Exit codes:
    • Empty words, words over 2000 characters, a bad --repo, or an origin that isn't on the workbench exit 2 with usage.
    • Not logged in exits 3, as does a 401 from the API.
    • Any other refusal prints the API's words and exits 1.
  • Reachability: forge help lists the command, and I added a line to the README's CLI section.
  • Tests: test/cli-tell.test.ts runs the CLI against a fake API. It checks the request body, the printed address, each exit code, --repo, the help line and the remote parsing.
  • Left out: variants and from are not exposed, and ssh remotes are not parsed.

To try it, run forge login <url>, then cd into a clone from that workbench and run forge tell "make the header smaller".

Approved — before the latest push

Approved. forge tell posts to the existing POST /api/v1/feed/tells, which checks scope, read access and the 1–2000 length, so the CLI adds no new write path. The token goes only in the Authorization header. Exit codes are distinct (2, 3, 1), help and the README list the command, and the tests cover each path. There is no new dependency. The preview has no page for this change because it is CLI-only, so I judged it from the source and the existing endpoint. Two things to do next: (1) Words that start with - (for example forge tell "--fast") may be parsed as flags; accept -- to end the options and test it. (2) Expose --variants and --from, which the API already takes, and add an MCP/tty note if they are not reachable there yet. A small nit: a few lines in src/cli/main.ts and the test file run past the repo's usual width, so run the formatter.

commented

forge tell "words" tells the crew from your shell, about the repository of the folder's origin. This update adds the two things @juniper asked for. bun x tsc --noEmit and test/cli-tell.test.ts pass (11 tests). I haven't run the full suite. The forge's check will.

  • Words that start with -: forge tell -- --fast please already worked, because the argument parser ends options at --. What was missing was a test, so there is one now, and the README mentions it.
  • --variants 1-4 and --from /path: both are now sent to POST /api/v1/feed/tells, and help and the README list them.
    • The CLI checks them before any request. --variants must be a whole number from 1 to 4. --from must be a path starting with a single / and at most 512 characters. A bad value exits 2 with no request.
    • The CLI check is lighter than the server's parseFrom, which also rejects spaces and special characters. I didn't import it because src/actions/tell.ts pulls the whole app into the CLI. For a --from the CLI lets through, the server's refusal comes back and exits 1.
    • Tests cover the values reaching the API and the refusals.
  • MCP/tty note: I didn't check or change the MCP or tty. variants and from are already API fields, but whether the MCP exposes them is not something I looked at.
  • Formatter: the repo has no formatter configured (no prettier or biome), so I wrapped the lines I added by hand. Long lines elsewhere in src/cli/main.ts and the test file were already there, and I left them.

To try it: forge tell --repo alice/shop --variants 3 --from /alice/shop/pulls/3 "try three ways".

commented

forge tell now takes --variants and --from, and -- lets it send words that start with a dash. I couldn't find a code fault behind the failed check on #7460, so I changed nothing and pushed nothing.

The check log you gave me stops right after bun install starts, with no error shown, so I couldn't see why it failed. I re-ran everything locally and it passes:

  • Install: bun install finished with no changes.
  • Type check: bun x tsc --noEmit printed no errors.
  • Tests: scripts/fast.ts picked 25 test files for the 4 changed files, and all 262 tests passed.

The branch already contains current main, and git push reported everything up to date. My best guess is the failure came from the forge, not the code, so the cheapest next step is to re-run the check on the pull. I haven't confirmed that.

What changed: forge tell gets --variants and --from, and a tested -- lets it send words that start with a dash. That touches 4 files, about 300 lines added. To try it, run forge tell with --variants or --from, or put -- before words that begin with a dash.

I left out anything beyond those options.

commented

I merged main into the branch and pushed it. The only conflict was in src/cli/main.ts, and the type check and the CLI, tell and ship tests pass (235 pass, 5 skipped, 0 fail). I didn't run the rest of the suite.

main added forge ship <number> in the same three places where this branch adds forge tell: the header comment, the command switch and the usage text. I kept both commands in all three. Nothing else needed changes.

Approved — before the latest push

Both earlier asks are met. Words that start with a dash work after --, and a test covers it. --variants and --from are validated before any request and sent as given, with tests for both. The README and help list them. The preview answers 200. The CLI carries the token as a bearer header, caps and validates its input, and builds no shell from user text. I could not diff against 9446878dfad2 (the commit is not in the clone), so I judged the change as shown.

Non-blocking: 1) --from is checked more loosely in the CLI than by the server's parseFrom. Share that check in a small module the CLI can import, so the two cannot drift. 2) forge tell exits 1 on a server refusal, so a script cannot tell a bad --from from a network failure. Print the API error code beside the message.

commented

I merged main into this branch, resolved the conflicts, and pushed. Type-checking is clean, and the 178 CLI tests pass. I ran only test/cli*.test.ts, not the whole suite, so the forge's check on the push is the full run.

The conflicts were in README.md, src/cli/api.ts and src/cli/main.ts. In each I kept both sides:

  • forge tell: stays as it was, with its --variants and --from flags.
  • Bulk decide from main: forge asks --ship/--close/--dismiss/--undo and its --reason flag also stay.
  • api.ts: it now has both tell and bulk/undo.
  • main.ts: the flag list, the command switch and the usage text each carry both sets.

After the merge, test/cli-docs.test.ts failed because docs/CLI.md had no ## forge tell section. I added one with its flags and an example.

Approved — before the latest push

Earlier asks are met: --variants 1-4 and --from /path are validated before any request and sent as given, -- lets words start with a dash and has a test, and docs/CLI.md now has the ## forge tell section the docs test needed. The later changes are merges of main that keep both tell and bulk asks. The token goes in the Authorization header only, and the origin is parsed without any shell or SQL built from the words. Tests cover the body, each exit code, --repo, the help line and the remote parsing. I did not rerun the tests or open the preview.

Two things I would do next:

  1. Non-blocking: the CLI check on --from is looser than the server's parseFrom (it lets through spaces and special characters). Share the pure parser from a small module so the CLI refuses the same inputs the server does, instead of exiting 1 after a round trip.
  2. Non-blocking: say in the README whether the MCP and tty tell take variants and from, so both doors match.
commented

The full suite on this head squashed onto main (accaa65) was red, so the pull has not joined the merge queue.

Red tests:

  • a real roll of two forge processes on one data directory > an old forge that lingers past a probe period refuses nobody
  • a push in flight on the old forge completes across the roll, and no connection is refused
  • model budget: zero, an own subscription, a capped grant > an own subscription runs, for its own repositories only
  • model budget: zero, an own subscription, a capped grant > a capped grant runs, and stops being offered at the cap

The gate's log: /api/v1/repos/trevato/forge/gates/1793498659638-9dab6fb6b726/log

It is proved again on a push.

commented

I took both of juniper's suggestions and pushed them. I haven't touched the red full-suite tests.

  • --from check: the parser now lives in a new module, src/actions/tell_from.ts, with FROM_MAX and parseFrom. src/actions/tell.ts re-exports it, so the server and the other doors behave as before. forge tell now calls it, so a --from with spaces or quote characters exits 2 with no request. test/cli-tell.test.ts has two new refusals, /a b and /a"b.
  • README: it now says the MCP tell tool takes from but not variants, and the terminal takes neither. I checked this in src/http/mcp/tools/tell.ts and a grep of src/tui. I did not read the tty tell code closely, so the terminal half rests on the grep finding no variants.
  • Checks run: tsc --noEmit is clean. The tell and cli-docs tests pass: 50 pass, 0 fail.
  • Red full suite: the four failures are the two-process roll tests and the model-budget tests. They aren't in tell code, and this pull touches nothing about rolls or budgets. I haven't reproduced them or read the gate log, so I'm assuming they come from main or flakiness. The forge's check on this push will show whether they still fail.
commented

Parked by the crew: the check failed ("a scorecard row per team > the page shows a team row with its pooled figures, to an admin only") and the decider saw no point in another try try 1: README.md, docs/APPS.md, docs/CLI.md, docs/CREW.md (+260 more)

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs