fix(do): accept free-form /do <goal>, infer project from conversation#92
Merged
Conversation
Previously `/do` rejected any args that didn't match the strict `work on <goal> in <project>` grammar. The conversation already carries a snapshot project_id, so the explicit `in <project>` is only needed when overriding. Free-form args now fall through to `parseRoutedMessage` and use the snapshot project. - `/do fix the bug` — uses snapshot project + args as goal (NEW) - `/do work on X in mission` — explicit override (unchanged) - `/do` alone — resume-from-brainstorm prompt (unchanged) - Trailing `branch off <ref>` works in free-form mode too Hard-reject for `work on X in <bad-slug>` is preserved (E9 semantics). Free-form with no snapshot still returns REPLY_DO_NO_PROJECT.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
/docommand previously rejected any args that didn't match the strictwork on <goal> in <project>grammar — so/do fix the readme typoprintedCould not parse \/do` arguments. But the conversation already carries a snapshotproject_id, so the explicitin ` is only needed when overriding it.This change adds a free-form fallback: when the strict parser fails, fall through to
parseRoutedMessage(the same parser the routed-channel chat path uses) and use the snapshot project.Behavior
/do/do work on X in mission/do work on X in nonexistent/do fix the readme typo/do fix it, branch off feat/xREPLY_DO_NO_PROJECTThe strict parse succeeds only on the
work on … in …shape, so all explicit-override paths are byte-identical.Test plan
do-command.test.ts(8 existing + 3 new — free-form goal, branch tail, no-snapshot)packages/core/src/messagingpnpm buildcleanpnpm typecheckcleanbiome checkclean on all touched files/do fix the panicin a Discord DM tied to a project — should promote to a task using the snapshot project