Repository navigation
feat: add session-scoped artifact lifecycle across CLI and VS Code - #826
Conversation
|
Hey @2409324124 - thanks for this - really solid work. Atomic writes at 0600, session-ID path validation, and DI on every new module so the tests use real temp dirs is exactly the standard I want to see. The A few things I'd want resolved before merge: 1. The walkthrough nudge is too eager. Related: 2. 3. Artifact dirs leak for non-persisted sessions. Smaller ones:
Also: the three new |
|
@will-lamerton Thanks again for the detailed review. I’ve pushed the final follow-up in The original review items have been addressed. During real local-model E2E testing, I also found one related session-title issue: autosave could derive the title first from the internal walkthrough fallback and then from the synthetic Validation completed:
Model compatibility note: during repeated runs, |
|
Hey @2409324124, could you please resolve the merge conflicts when you get a chance? |
- Add /test, /explain, /doc dropdown in chat input - Template text injected into textarea on selection - What user sees is exactly what gets sent to AI - Add 6 tests in chat-webview-provider.spec.ts - Add changeset for patch release
|
Hi @2409324124, thanks for this PR! It looks like a codeowner has left feedback Whenever you get a chance, could you take a look at the open comments? |
|
@akramcodez Thanks for the reminder! I’ve merged the latest A few of them involved overlapping ACP / VS Code cancellation and queued-tool changes, so I reconciled the behavior from both sides and added regression coverage rather than just choosing one version. The PR is mergeable again, and the latest CI run has been triggered. Thanks! |
|
@akramcodez tks for the ping! synced w/ latest main again; conflicts resolved, artifact lifecycle semantics kept. types/lint/build/tests/audit/security pass. pls take another look when u can. |
The GitHub release body is CHANGELOG.md piped through extract-changelog.js, so a contributor is only named when whoever wrote the changeset remembered to type "Thanks to @Someone". v1.30.0 named 4 people; 21 had merged PRs. Adds scripts/generate-contributors.js, which asks GitHub's own releases/generate-notes API who authored the PRs between the previously published version and the one being released, filters bots, and prints a Contributors section. Attribution is PR-author based rather than commit-author based, so squash merges are credited correctly. The release workflow inserts that section above Installation. The script exits 0 and prints nothing on any failure, so a release can never break because the credits could not be built.
…ective#733) * fix(daemon): handle macOS socket path length limit On macOS Unix domain socket paths are limited to 104 bytes. When project root exceeds this, use a hashed path in temp dir. Add test coverage for the macOS-specific behavior. * added changeset * fix(daemon): fall back for long macOS socket paths * Fix macOS daemon startup for long socket paths Fixed daemon startup issue on macOS due to long socket paths by implementing a fallback to a hashed socket name.
…nches Follow-up to Nano-Collective#733. - Apply the sun_path cap on every Unix platform, not just macOS (104 bytes on darwin, 108 on Linux/BSD). A deeply nested project hit the same silent-truncation bug on Linux. - Bind at exactly the capacity: a path of exactly sun_path bytes binds fine, truncation starts one byte later, so the check is `>` not `>=`. - Fall back to /tmp when TMPDIR is itself long enough to push the hashed name back over the limit. - Split the platform-dependent logic into a pure resolveSocketPath(root, platform, tmpDir) so every branch is testable from any OS. The previous test no-opped entirely on CI, which is Linux-only. - daemon start now reports the socket path from the lockfile rather than recomputing it: the path depends on TMPDIR, which need not match between a launchd/systemd-started daemon and the CLI. - Document the fallback in docs/features/skills.md.
feat(vscode): add slash command autocomplete quick actions Resolved conflicts in chat-panel.html and chat-webview-provider.ts: main added the uri-utils.js drop-payload helper while this branch added slash-command-utils.js. Both script tags and both webview URIs are kept, with uri-utils.js moved onto the same mtime-based cache key as the rest.
…review Lifecycle: the menu only closed on input or Escape, so it survived blur and caret moves. It now closes on blur and re-evaluates on selectionchange, both mirroring the @-mention dropdown. Enter no longer claims the keystroke unless the completion actually lands, so a stale token falls through to submit rather than silently eating the key. Escape stops propagation so dismissing the menu mid-stream no longer cancels the in-flight request, and dropdown rows select on mousedown so blur cannot beat the click. Removed the three chip guards. pathInfoResolved only ever originates from a drag-drop or the native open dialog, both of which the extension has already stat'd, so a command name can never arrive as a chip; what the guards could match was a real file or folder named /test, /explain or /doc, which they dropped silently. Dropped the inline copy of the command table and helpers from chat-panel.js. slash-command-utils.js always loads first, exactly like mention-utils.js, which carries no such fallback. Applying a command now replaces the token in place instead of concatenating and trimming the whole composer, so text above and below a command keeps its position and line breaks. /clear and /copy joined the menu as commands with no template: the menu completes the name and the existing handlers run it. assetVersion falls back to the extension version if statSync throws. chat-panel.css is a build output, and an unbuilt one used to render the panel unstyled rather than throw out of getHtml. Retargeted the spec at the helpers it actually covers and renamed it to match the mention-utils.spec.ts convention. It asserted against source text of chat-panel.js, including the absence of an identifier that never existed, which passed whether or not the wiring worked.
* feat: add .nanocoderignore file support * fix: Resolve lint errors * docs: add changeset for .nanocoderignore support * refactor: rename cwd to workspaceRoot in loadGitignore Co-authored-by: Copilot Autofix powered by AI <[email protected]> * test: add read-error coverage for .nanocoderignore * style: fix formatting for loadGitignore signature --------- Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Follow-up to Nano-Collective#881. - Exclude .nanocoderignore from checkpoint snapshots via a new loadGitignore({nanocoderIgnore: false}) opt-out. Hiding a file from the model's listings shouldn't drop it from restore, which previously meant a .nanocoderignore'd package-lock.json was silently unrevertable. - Document that .nanocoderignore is context hygiene, not a secrets boundary: read_file and execute_bash don't consult it, so a listed .env is still readable by path. - Document `!` negation instead of claiming patterns are purely additive. The ignore package honours negations across add() calls, so a .nanocoderignore entry can un-ignore .gitignore and default rules. - Add a proper docs/configuration section and point file-explorer and checkpointing at it. - Cover negation, ordering and the checkpoint opt-out with tests.
* added timeline tracker * Omit local timeline test artifacts from the branch. Session snapshots and the scratch test.txt were captured during manual testing and should not ship with the feature. Co-authored-by: Cursor <[email protected]> * fix: stub isReadOnly on ACP queued-tools test mock (Nano-Collective#2) Timeline capture now calls toolManager.isReadOnly() during tool execution. The queued-tools spec mock omitted that method, so four tests failed in CI with "isReadOnly is not a function". Co-authored-by: Cursor Agent <[email protected]> * semgrep error * passes tests * fix: load slash-command helpers in chat-panel tests and quiet path-join scan The panel IIFE reads NanocoderSlashCommandUtils at eval time, so the harness must load slash-command-utils.js (and uri-utils.js) before chat-panel.js. --------- Co-authored-by: Cursor <[email protected]>
…eview Correctness and data-safety fixes for the timeline undo feature: - Exclude .nanocoder/timeline and .nanocoder/checkpoints from capture. User projects have no reason to gitignore them, so every opaque capture was snapshotting the previous one: quadratic growth, real files crowded out of the scan cap, and a revert walking its own internals. - Skip the checkpoint when the dirty-file scan is truncated or git is unavailable. A truncated scan makes an already-dirty file look clean, so its before-image was taken from HEAD and a revert would discard the user's uncommitted work. - Skip binary files rather than round-tripping them through UTF-8, and keep "binary in HEAD" distinct from "absent from HEAD" so a revert cannot delete a tracked binary the tool merely edited. - Revert a whole assistant turn at once. Reverting the second call of a multi-call turn erased the first from history but left its edits on disk. - Validate paths read back from timeline.json before writing or unlinking, and add the same containment check to FileSnapshotService.restoreFiles. - Resolve the truncation point from the tool call id, clamping the stored index, so a shifted history cannot mis-truncate. - Prune timeline data from abandoned sessions instead of growing forever. - Keep the chat thread on screen when a revert is refused: buffer the agent's replay and only clear the panel once the revert has actually happened. - Fix the auto-scroll target and replace the clipped hover tooltip with a hint line that also responds to keyboard focus. - Drop the unused onTimelineUpdated hook and the five tool names in NON_WORKSPACE_TOOLS that do not exist. - Cover the opaque capture path and the webview strip, and stop the specs from leaving temp directories behind.
…lective#765) (Nano-Collective#837) Co-authored-by: yulinlina <[email protected]>
…no-Collective#837 - Replace the vacuous `%4d:` source grep with behavioural assertions that execute read_file and compare the returned string to the fixture verbatim. - Guard string_replace and diff_edit individually instead of files.some(), so one tool regressing can't hide behind the other. - Add the missing title/description/sidebar_order frontmatter so the page renders titled and lands ordered in the sidebar. - Document write_file, which deliberately returns stats only and no file content, and guard that with a test too.
Co-authored-by: Checkmate <[email protected]>
…ve#886) * fix: use os.homedir() for models cache path on Windows process.env.HOME is undefined on Windows, causing path.join('~', '.cache') to create a literal ~ directory. Use os.homedir() which resolves correctly on all platforms. * chore: add changeset for Windows models cache fix * fix: use os.homedir() in fetch-models.js and add Windows regression tests - Fix scripts/fetch-models.js to use os.homedir() instead of process.env.HOME || '~' which produces a literal ~ directory on Windows - Add regression tests that verify the old pattern produces a literal ~ while os.homedir() resolves the real home directory
… merge Nano-Collective#898 merged upstream main by taking its own stale side of chat-panel.js and chat-panel-harness.ts, silently reverting work that was already on main and leaving 34 tests failing. `test:types` stayed green because tsconfig excludes *.spec.ts, so the breakage never surfaced in CI. Rebuilds chat-panel.js from the pre-merge file and reapplies the work summary on top, so the following come back: - the action timeline strip and its undo (Nano-Collective#887), which the HTML and the extension host were still wired for - slash command autocomplete, likewise still wired for in the HTML - editor-tab drag and drop via NanocoderUriUtils.parseDropPayload, which had been replaced by an older inline copy full of scratch comments - the MCP settings button opening .mcp.json rather than agents.config.json - the cancelled icon on a denied edit card - the per-turn footer, and the harness capabilities the timeline, aggregation and footer specs drive Fixes in the work summary itself: - a tool reporting back after Stop no longer opens a second "Working..." box with a timer nothing ever stops. ensureCurrentWorkSummary() refuses to open a turn once turnCancelled is set; a card already on screen still takes its update, so a call cancelled mid-flight reports its real outcome. Deliberately not gated on isProcessing, which would drop every card of a replayed session. - whitespace-only reasoning no longer reveals an empty summary and splits the answer around it - the summary is inserted at its first activity rather than at turn start, so a turn that answers before it works keeps its transcript order - a manual collapse or expand survives the end of the turn - an emptied plan retires the summary it was the only activity in Regenerates chat-panel.css for the new work-summary classes.
Conflict resolutions: - tool-validation: keep main's abort-signal comment, widen options to ToolExecutionContext - session-history-renderer: keep main's usage-footer preference plus the PR's internal-message filter - acp-client: keep main's cancelled stopReason, adopt the PR's per-attempt cancel tracking - chat-webview-provider: fold the PR's postPromptResponse helper into main's outcome field - acp-conversation.spec: unique per-test session ids that are also UUID-shaped - chat-panel.css / nanocoder-vscode.vsix: taken from main, rebuilt below
…ycle Correctness: - tool-manager: copy instead of push when injecting write_plan, so plan mode no longer permanently mutates the shared TOOL_PROFILES array - subagents: exclude write_plan/write_tasks/write_walkthrough from the offered set and hard-stop them at the execution boundary; subagents run with the parent session id and could otherwise overwrite its artifacts - session-manager: validate a caller-supplied session id before it reaches path.join; session-id: lowercase-only, matching crypto.randomUUID() Plan mode must never dead-end: - approved-plan and the VS Code PlanReviewController degrade to approving against the transcript when the plan artifact is missing, empty, or unreadable, instead of throwing and leaving Yes permanently broken - restore the 'Ask me clarifying questions' review option dropped by the PR Walkthrough lifecycle: - skip the nudge when the turn was cancelled, and flushAll before recursing so the prior turn's task panel lands in scrollback like every other site - keep the internal nudge out of the persisted session file - plain runs no longer force a walkthrough by default: the artifact directory is deleted on exit, so the extra model turn produced a file nobody reads Housekeeping: - ArtifactManager.cleanupOrphanedSessions plus a startup sweep, so artifact directories are reclaimed when a session is never persisted (autosave off) or retired by /clear VS Code: - drop the submit guard that silently discarded a follow-up typed mid-turn - render a user bubble for plan approval and surface approval errors in the transcript, not only as a toast
…s.json Subagents: - enforce the declared `tools:` allow-list at the execution boundary, not only when choosing what to offer. getToolHandler resolves a handler for every registered tool, so a subagent naming a filtered tool still ran it — a read-only agent like `explore` could write files. This supersedes the narrower artifact-tool guard. Tasks: - remove the legacy `.nanocoder/tasks.json` fallback in the working directory. Task state is session-scoped; every caller has a session id, so the fallback was a way to leak agent bookkeeping into the user's repo and share one list across concurrent sessions. Without a session, reads return empty and writes are a no-op rather than touching cwd. - getTasksPath now returns string | null to make that explicit - rewrite the storage and /tasks specs against the session-scoped model instead of faking process.cwd() Docs: - task-management: correct storage location, correct the tool name (write_tasks, not create_task/list_tasks/update_task/delete_task), note the profile gap and the upgrade path - development-modes: document write_plan, the plan review options, session artifacts, and the nano/minimal plan-mode tool sets - tune: note that write_tasks/write_walkthrough are full-profile only, and correct the nano profile listing (diff_edit, not string_replace) - subagents: document allow-list enforcement and artifact-tool exclusion - session-management: document the artifacts directory and its lifecycle
… plan UI Walkthrough was never written after approving a plan and letting the model edit files. Two causes: - After edits the loop appends its post-edit diagnostics prompt with role 'user'. createWalkthroughLifecycle scans back for "the latest user message" to decide whether the turn owes a walkthrough, so it saw the diagnostics prompt, concluded the user had moved on, and dropped the requirement. The diagnostics message now carries an exported marker and is skipped, alongside the internal nudge. - Only the walkthrough-fallback recursion carried walkthroughLifecycle forward; every other recursion rebuilt it from the message tail, losing the `written` and `fallbackAttempted` flags. All recursion sites now thread it, so it is built once per user turn as intended. UI, from testing feedback: - plan review prompt: the saved-path block was four lines stacked with no breathing room. The clickable link now leads with the Cmd/Ctrl hint beside it, the raw path sits below it dimmed as the copy/paste and non-OSC-8 fallback, and the groups are separated. - dropped the "Executing exits Plan Mode…" line: the highlighted option's own description already states the consequence. - artifact shortcuts move from above the composer to below it, alongside the mode indicator, and pick up ChatInput's margin so they line up with the status line instead of sitting one column in.
A build-time symlink in a scratch worktree was picked up by `git add -A`. Because it resolved to the repository's own node_modules, checking the branch out replaced a real node_modules with a self-referential link, and pnpm failed with ELOOP. The .gitignore entry only had the trailing-slash directory form, which does not match a symlink of the same name — both forms are now listed.
|
This was a massive one, but, it's amazing work @2409324124 - merging and appreciate the patience :) |
Description
Adds a complete session-scoped artifact lifecycle across the CLI and VS Code extension, following the planning, task tracking, and completion flow requested in #805.
The implementation:
implementation_plan.md,task.md, andwalkthrough.mdin isolated session artifact directoriestasks.jsonwhile exposing only the three user-facing lifecycle artifactswrite_walkthrough, with structured files-changed, truthful test results (or an explicit untested reason), and verification steps.nanocoder/tasks.jsonin the target projectCloses #805.
Type of Change
Changeset
pnpm changeset) describing this change for the changelogTesting
Automated Tests
.spec.ts/tsxfilespnpm test:allcompletes successfully)Validated successfully with:
pnpm run test:typespnpm run format:checkpnpm run test:lintpnpm run test:knippnpm run test:auditpnpm run buildpnpm --dir plugins/vscode run buildnode --check plugins/vscode/media/chat-panel.jspnpm exec tsc -p plugins/vscode/tsconfig.json --noEmitpnpm changeset status --since=origin/mainThe complete AVA command was also run. Its assertions, including the CLI integration group, passed, but the repository's existing long-lived handle issue still makes the command time out while exiting
client-factory.spec.tsandai-sdk-client.spec.ts; the focused changed-area suites above exit cleanly.Manual Testing
Real Ollama CLI validation was completed locally:
qwen3-coder:30b(30.5B, Q4_K_M), using a 32K context and fully GPU-offloaded (49/49 layers) on an RTX 3090/exitautosave →--continuelifecycle run preserved all 22 messages, including the approved-plan and internal-walkthrough protocol messages, plus both artifacts, while retaining the original user request as the persisted and resumed session titleReal CLI and VS Code Extension Host flows were tested with an inherited API-key environment (no credentials added to the repository):
.nanocoderstatenpm test, and generated a Walkthrough0600permissionsPrompt failed, a missing tool result, or an Internal errorChecklist
Screenshots
CLI artifact lifecycle
VS Code artifact lifecycle
VS Code walkthrough