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

A /talk line that starts with a slash runs a short command: /issue, /pull, /wallet #13982

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

A /talk line that starts with a slash and a letter now answers a read-only command in the thread: /issue N, /pull N and /wallet. /pull N has no test. The gate, the type check and the new tests pass; the forge's full check has not run yet.

Notes

shipped production is serving it deploy 4adf612

opened this

A /talk line that starts with a slash and a letter now answers a read-only command in the thread: /issue N, /pull N and /wallet. /pull N has no test. The gate, the type check and the new tests pass; the forge's full check has not run yet.

What changed

  • Commands: the answer comes from the repository's own issue, pull and wallet data. /issue and /pull give owner/repo#N: title, state and author, the body (capped at 600 characters) and the page path. /wallet gives the balance line, the three latest spends and the page path. It is not the pages' exact rendering.
  • No model turn: it runs in say() (src/crew/conversation.ts), next to the "what needs me?" shortcut, so the terminal's talk gets the same answers. Only the two thread turns are written. A command typed while an answer is still running is queued like any other message.
  • Unknown command: the answer says so and lists the table of commands.
  • Which repository: owner/repo typed in the line (/issue owner/repo#7, /wallet owner/repo), or else the one the chat is about (/talk?about=owner/repo). If neither is given, it says how to name one.
  • Access: a repository or number you cannot read answers Not found., the same as its page.
  • Tests: test/talk-slash.test.ts covers /issue, /wallet, the unknown command, a private repository read by someone else, a missing number, and a missing repository.
  • Docs: docs/features/talk-slash.md, with its index row in docs/features/README.md.

Not done

  • /pull N test: it shares the code path with /issue N, but the test only checks that /pull on an issue number answers Not found.. Opening a real pull needs git setup that was too heavy here.
  • Default repository: no command guesses a repository when none is named.
  • Writing commands: none exist.
  • src/web/: nothing there changed. The issue's file list names talk.ts and talk_build.ts, but they didn't need touching. The new code is in src/actions/talk_slash.ts.

Try

  • Open /talk?about=owner/repo on the preview and send /issue 1, /wallet, then /nope.
  • Locally: bun test test/talk-slash.test.ts.

The commit carries No door: and Direction: lines for the gate's two rules.

Closes #13971

4 earlier comments · 1 event
commented

A /talk line that starts with a slash and a letter now answers a read-only command in the thread: /issue N, /pull N and /wallet. /pull N has no test. The gate, the type check and the new tests pass; the forge's full check has not run yet.

What changed

  • Commands: the answer comes from the repository's own issue, pull and wallet data. /issue and /pull give owner/repo#N: title, state and author, the body (capped at 600 characters) and the page path. /wallet gives the balance line, the three latest spends and the page path. It is not the pages' exact rendering.
  • No model turn: it runs in say() (src/crew/conversation.ts), next to the "what needs me?" shortcut, so the terminal's talk gets the same answers. Only the two thread turns are written. A command typed while an answer is still running is queued like any other message.
  • Unknown command: the answer says so and lists the table of commands.
  • Which repository: owner/repo typed in the line (/issue owner/repo#7, /wallet owner/repo), or else the one the chat is about (/talk?about=owner/repo). If neither is given, it says how to name one.
  • Access: a repository or number you cannot read answers Not found., the same as its page.
  • Tests: test/talk-slash.test.ts covers /issue, /wallet, the unknown command, a private repository read by someone else, a missing number, and a missing repository.
  • Docs: docs/features/talk-slash.md, with its index row in docs/features/README.md.

Not done

  • /pull N test: it shares the code path with /issue N, but the test only checks that /pull on an issue number answers Not found.. Opening a real pull needs git setup that was too heavy here.
  • Default repository: no command guesses a repository when none is named.
  • Writing commands: none exist.
  • src/web/: nothing there changed. The issue's file list names talk.ts and talk_build.ts, but they didn't need touching. The new code is in src/actions/talk_slash.ts.

Try

  • Open /talk?about=owner/repo on the preview and send /issue 1, /wallet, then /nope.
  • Locally: bun test test/talk-slash.test.ts.

The commit carries No door: and Direction: lines for the gate's two rules.

Changes requested — before the latest push

The shape is right: one small module, read as the signed-in person, runs in say() so the terminal gets the same answers, docs under docs/features with the index row, and nothing added to README. One thing blocks it: /pull N has no test that would fail without it, and the issue box 3 asks for a test per command. Fix first: open a real pull in the test (or insert one through the core pulls API) and assert alice/lab#N: <title> and the state line; also assert that /issue on a pull number is Not found. Also: (1) box 1 says the same words as their pages, but the PR text admits it is not the pages exact rendering; either reuse the page word builders or state in docs/features/talk-slash.md precisely which words are shared. (2) Drop the number! non-null assertion by returning number as number | null or splitting the wantNumber path. (3) Test that a line sent while an answer is live is queued, not run, since that branch is added in say(). This is a feature while the direction is pipeline first; keep it small and land it only after the pipeline items it does not touch.

commented

A /talk line that starts with a slash and a letter now runs a read-only command: /issue N, /pull N or /wallet. This push addresses the review. bun x tsc --noEmit and test/talk-slash.test.ts pass. I did not run scripts/fast.ts, and the forge's check runs the full suite.

  • /pull N test: the test opens a real pull through openPull and asserts alice/lab#N: Add x, open, by alice, the body and the page path. It also asserts that /issue on that pull's number is Not found., as /pull on an issue number already was.
  • Non-null assertion: target() now returns number | null. change() checks for null itself, and wallet() never reads the number, so number! is gone.
  • Queued slash line: a new test starts a turn with a gated stand-in agent, then sends /issue 1 while it runs. It asserts the line comes back queued and that neither the line nor its answer is in the turns. Then it releases the turn. This covers the live branch in say(). The files.length === 0 branch has no test.
  • Shared words: I chose to state it rather than reuse the page builders. docs/features/talk-slash.md now says the answers share the pages' facts, not their rendering. Issues and pulls read the same title, state and author through getIssue and getPull, and /wallet uses the wallet page's own reader, readWalletSummary. Layout, labels and markdown are not shared, and the body is plain text cut at 600 characters. I also reworded the module comment, which said "the page's own words".
  • Left out: I did not reuse the page word builders, and I did not add commands that write.
  • Ordering: I read "land it only after the pipeline items it does not touch" as a merge-ordering note for a person. I changed nothing for it.

To try it, open /talk and send /issue 1 owner/repo, /pull 2 owner/repo or /wallet owner/repo.

🤖 Generated with Claude Code

commented

The check failure was the gate's real-timer rule, which flagged test/talk-slash.test.ts:141. That line is the one wait left in the queued-slash-line test. It polls until the stand-in agent process exits after release. I marked it // real-timer: with the reason, because the wait is on a separate process and a stepped clock can't replace it.

bun scripts/gate.ts printed nothing after the commit, and test/talk-slash.test.ts passes (10 tests). I pushed as 472944df8 and have not yet seen the forge's check run on it.

The pull still reads as before: /talk lines starting with a slash and a letter run /issue N, /pull N or /wallet, read-only, as the signed-in person. Tests cover /pull N, /issue on a pull number being Not found., and a slash line sent mid-answer being queued. The docs say which words are shared with the pages. To try it, open /talk and send /issue 1 owner/repo, /pull 2 owner/repo or /wallet owner/repo.

🤖 Generated with Claude Code

commented

I fixed the talk-slash.test.ts failure and pushed 92f6b8a15. I did not touch the live previews failure. tsc is clean, and talk-slash.test.ts plus conversation-queue.test.ts passed three runs in a row (13 tests). I have not seen the forge's check run on this push.

The cause: a slash line queued behind a running turn was handed to the model when its turn came. The stand-in agent was left running when the test ended, and the test's cleanup removed its data directory underneath it. That is why the failure showed up as a 0.25 ms fault attributed to line 141, and why it only appeared in the sharded run.

The fix: drain() in src/crew/conversation.ts now answers a queued slash line itself, the same way an immediate one is answered. A queued line keeps the about it was sent with, so a bare /issue 1 still names its repository. The test now waits for that answer and fails if it never comes, so nothing outlives it. I added a line about this to docs/features/talk-slash.md.

live previews failure: "a fresh account's second preview is refused with the count on its run" ran 420 s in shard 14 and is unrelated to /talk. Neither the pull nor the repo's tests touch preview limits, so I left it alone. It may be a flake, and I could not check it here.

🤖 Generated with Claude Code

commented

A /talk line that starts with a slash now runs a read-only command (/issue N, /pull N, /wallet) and answers it directly, without sending it to the model. A line sent while an answer is running is queued and answered when its turn comes. This push only fixes the check, which failed because of a test I wrote.

The cause. The wait in test/talk-slash.test.ts had its // real-timer: note at the end of the loop line. The review rule needs that note on the sleep line. The flake detector then read the comment as part of the loop and swallowed the following expect(answered()), so it flagged the wait as one that runs out and carries on. I put the sleep in a braced body with the note on the sleep line, so both rules are satisfied.

What I ran.

  • test/talk-slash.test.ts, test/flake.test.ts, the review-rules tests and bun x tsc --noEmit pass.
  • The detector now returns no findings on the file.
  • The other three failures were "the guides are read once…", the private-fork test and the fast-forward test. I couldn't find any test titled "the guides are read once". The fork and fast-forward tests are in test/take-expect.test.ts and test/boundary-fork-objects.test.ts, which pass when run alone, and I made no change to them. I take them for shard flakes, so I changed nothing for them. If the forge's check fails them again, send me that log.
  • I did not run bun scripts/gate.ts --fix; it printed nothing I could read, so treat that step as unverified.

Left out. The slash commands are read-only; nothing that writes or spends is available from /talk.

To try it. Open /talk, send /wallet owner/repo, then send /issue 1 while another answer is running to see it queued.

Approved

Earlier asks are met: /pull N has a real test, the non-null assertion is gone, the queued slash line is answered in drain() and tested, the docs say which words are shared, and the real-timer wait is marked. Reads are gated as the signed-in person (canRead plus mayViewId, with wallet through readWalletSummary). The terminal goes through the same say(), and the how-to is docs/features/talk-slash.md, not the README. Two things I would do next. Non-blocking: 1) a line sent with during=inject while a turn is live skips the slash shortcut and reaches the model, so route it through slashAnswer too. 2) Test the files.length===0 guard, so a slash line with an attachment still goes to the model.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs