Repository navigation
feat(agent): add dimcode persistent Pi terminal harness - #4095
spomichter wants to merge 9 commits into
Conversation
❌ 5 Tests Failed:
View the full list of 5 ❄️ flaky test(s)
To view more test analytics, go to the Test Analytics Dashboard |
|
| seq: entry.seq, | ||
| busy: entry.running, | ||
| writable: entry.owner === socket, | ||
| messages: session.messages, |
There was a problem hiding this comment.
If a saved session's message history exceeds the 16 MiB socket packet limit, attaching to it sends the complete session.messages array in one snapshot and closes the connection instead of returning state. Image and tool-result history can make a persisted session unreachable from the terminal. Truncate or paginate snapshot history, or stream it separately.
Artifacts
- Authored TypeScript probe that starts the actual gateway, injects boundary-sized session messages, and makes real Unix-socket requests; it is the executable reproduction source.
- Captured execution output from the actual gateway probe shows a 15 MiB snapshot response succeeds while a 17 MiB snapshot response closes without data, demonstrating the bounded-send behavior.
| for (const packet of pending.splice(0)) | ||
| if (packet.seq > current.seq) apply(packet.event); |
There was a problem hiding this comment.
When /new or /resume switches sessions while the previous session is still emitting events, queued events are accepted using only their sequence number. Since each session has its own sequence counter, an old event with a higher number can be rendered into the newly selected session, adding stale text or tool cards to the wrong transcript. Keep queued events associated with their originating session and apply only events for the current session.
Artifacts
- The authored Node harness reads the exact terminal source gate and executes the pending-event restore sequence, ending with the reproduced stale rendering.
- The executed harness output records old-session sequence 41 being queued and `STALE-A-EVENT` rendering after B's sequence-0 snapshot, confirming the defect.
- The authored Playwright script renders the inspected source gate and the executed reproduction outcome into the paired UI videos, ending with visual proof.
- Playwright Chromium captured the terminal restore code before the reproduction, highlighting the sequence-only gate that permits cross-session packets.
Poster frame of terminal source sequence-only gate
- Poster frame highlights lines 364-365 comparing only `packet.seq` and `current.seq`, establishing the faulty precondition.
- Playwright Chromium captured the focused runtime outcome where `STALE-A-EVENT` appears under `dimcode · B-new-session`, confirming the regression.
Poster frame showing stale A event in new B session
- Poster frame visibly shows the old-session event rendered after the new-session restore, confirming incorrect session isolation.
- The capture command log records the executed Chromium video capture and successful exit, confirming the visual evidence was generated.
| - run: npm run check | ||
| env: | ||
| DIMCODE_TEST_DENO: deno |
There was a problem hiding this comment.
The workflow sets DIMCODE_TEST_DENO but not DIMCODE_TEST_PYTHON, so the real DimOS MCP image and error interoperability test is skipped. It also does not run for dimos/** changes. This is non-blocking, but changes at the Node/Python MCP boundary can merge without exercising their integration; provision Python, set DIMCODE_TEST_PYTHON, and include the relevant DimOS paths.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Artifacts
- The authored non-product shell harness compiles the checked-in test, runs its workflow-equivalent and Python-enabled variants, and evaluates the literal workflow paths; it provides reproducible validation.
- The focused Node test ran from `agent` with Deno set and Python unset, matching the workflow's integration environment; it reports one skipped test, proving the Python MCP coverage does not execute.
- The same Node test ran with the repository Python image and passed the real DimOS handlers, image, and isError flow; the appended workflow check shows a DimOS MCP source change does not match configured paths.
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. |
|
This pull request has been automatically closed because it has been stale for 30 days with no activity. Feel free to reopen it if you plan to continue working on it. |
Contribution path
END-112.
Problem
A DimOS coding agent needs to install DimOS, build apps and manage blueprints without requiring a blueprint's LLM client to be running. Users also need an interactive setup and a working terminal entry point.
Solution
Add
agent/, packaged as@dimensional/dimcode. A persistent user gateway embeds upstream Pi sessions;dimcodeordimcode tuiopens the terminal. First-run setup covers credentials, model, workspace, DimOS install/connection, MCP and the user daemon. Pi supplies coding tools, provider auth and message/tool components. Existing MCP exposes all advertised skills; lifecycle and development work use the existing CLI/Python APIs. Web SDK media connects only for active render consumers.Normalize MCP images/errors, add exact
--runselection and preserve the Python interpreter for restart. Session events carry their origin; bounded terminal snapshots keep large saved histories attachable without modifying model history. No Pi fork or additional DimOS daemon.The terminal uses Pi's fullscreen layout, scrollable transcript and multiline editor. Memory analysis stays in DimOS: one materialized query supplies native Space/Plot SVGs and selected-frame exports, displayed together in a tool card with clickable panels and
/panel N. Every image reaches model context, with per-export source hashes. Saved XYZ results support rotation/zoom with terminal graphics or Braille. Tagged cloud/image frame indexes now render inside the same tool cards with source-timed inline looping. Playback buttons, timelines and play/pause/seek commands are intentionally absent; the agent selects a requested still from the saved frame index. A shared point painter fixes camera/bounds/height scale across clips. GIF exports and timestamped model contact sheets retain original frame indexes; an individual source frame can be requested without repeating the query. Built-in presentation stays restricted to point clouds and images/SVGs; all generic plots/graphs come from DimOS or Python.Breaking Changes
Existing CLI defaults remain compatible. MCP images use standard image blocks; failed calls set
isError. The dimcode socket is internal to the package; restart the gateway when upgrading this prerelease.How to Test
For the local packaged build:
dimcode setup, thendimcode(ordimcode tui). Seeagent/README.mdfor the wizard, local tarball install, contributor commands and reproducible E2E flags. npm publication is deferred.unitree-go2replay + cockpit + Node Web SDK: 12 distinct video frames, 7 full XYZ clouds (33,454–33,568 points, source hashes verified), 16 odometry frames, and zero viewers/subscriptions after consumers close. No physical hardware or model key is needed for this test.Linux x64/Node 24 is validated. Physical hardware, arm64, Node 26 and actual subscription OAuth login remain unverified. Video coverage is consecutive JPEG frames, not H.264. The recording E2E is explicitly skipped unless its environment flags are supplied. Previous CI's macOS job failed on missing nix/SocketCanBus dependencies; project coverage delta was -0.06%. Updated CI is pending.
AI assistance
Codex (GPT-6) implemented and validated this change.
Checklist