Resolve project names to active durable tasks - #34
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7533b14671
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| command: Extract<DAICommand, { readonly kind: "continue" }>, | ||
| dependencies: DAIRuntimeDependencies, | ||
| ): Promise<string | DAIResponse> { | ||
| const exact = await dependencies.store.load(command.taskIdOrProject); |
There was a problem hiding this comment.
Skip task-ID lookup for non-task project names
When the project name is not valid task-ID syntax—for example .github, which is accepted by the runtime's own remote-repository format—the configured FileDurableContextStore.load() throws InvalidTaskStateError here instead of returning a miss, so discovery never runs and @D-AI continue .github rejects its promise rather than resolving the matching task. Gate this lookup on task-ID syntax or treat an invalid task ID as a miss before performing project discovery.
AGENTS.md reference: AGENTS.md:L7-L9
Useful? React with 👍 / 👎.
| const repository = entries[0]!.slice("remote-repository:".length); | ||
| const separator = repository.lastIndexOf("/"); | ||
| return separator < 0 || separator === repository.length - 1 ? null : repository.slice(separator + 1); |
There was a problem hiding this comment.
Validate the full repository identity before matching
When persisted state contains a malformed repository identity such as remote-repository:garbage/D-AI-Hub, this extraction still returns D-AI-Hub; the durable-state schema permits arbitrary manifest strings, and workspace discovery validates only the workspace identity, so the resolver can select and continue a task whose claimed repository identity was never valid. Require the complete canonical host/owner/repository shape before using the final segment so malformed identity data fails closed.
Useful? React with 👍 / 👎.
Problem
Natural-language project continuation must resolve only a canonical durable project identity in the current workspace. Revision 2 also hardened invalid task-id probes and bounded ambiguity output.
Solution
Resolve an exact project name from the single persisted remote-repository: identity among active durable tasks discovered for the current workspace, then route exactly one match through the existing continue path. Exact task-id loads retain priority only for task ids accepted by the existing durable-store syntax rule. The remote identity must match the approved host/owner/repository shape before its final segment is used.
Fail-closed
Zero matches, closed-only tasks, wrong-workspace tasks, malformed repository identity, invalid task-id-shaped input, and multiple matches block without creating or mutating a task. Multiple candidates are sorted by task id, capped at 3 displayed candidates, each task id/stage/workspace identity field is bounded to 96 characters, and the response reports total and omitted counts. No goal or other metadata is exposed.
Compatibility
Existing status/close discovery and explicit task-id continuation remain unchanged. Natural-language activation continues to use the existing parser and runtime seams. The runtime reuses the durable store task-id and remote-repository validation rules without changing the store.
Out-of-scope
No new durable schema, registry, parser, command-runner, actor/session, Memory, aliases, semantic matching, task auto-creation, or cross-workspace resume behavior.
Revision 3 evidence
Review thread classification
Revision 4 evidence