CORE V3.8.1#33
Merged
Merged
Conversation
… object
OutputFormatText and OutputFormatJsonSchema are Schema.Class, so their
encoders are instanceof-gated. The task tool built `format` as a plain
object literal, which passed TS structural typing and decode but failed
at encode when the user-message Info was serialized onto the
MessageUpdated sync event — surfacing as "Expected OutputFormatJsonSchema,
got {...}" at ["info"]["format"] and killing researcher/reviewer subagent
runs that use output_schema.
- prompt(): normalize `input.format` through decodeUnknownSync(Format) at
the single choke point every caller flows through, coercing any
structurally-valid format (plain object or instance) into a proper
instance; idempotent, and fills retryCount.
- task tool: construct `new OutputFormatJsonSchema(...)` at the source
for defense-in-depth and clarity.
- Add encode regression tests (the prior suite tested decode only, which
is how this slipped through); both json_schema and text variants are
instanceof-gated, so both are covered.
Verified: structured-output suite 26/26, typecheck 23/23. The 12
session.llm.stream / native-recorded failures are pre-existing network
fixture failures (confirmed identical with these changes stashed).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Three defects surfaced in a real multi-agent run:
1. Subagents never "closed". A subagent does one turn then the runtime
drops it to in-memory `idle` (never persisted), so the panel showed
every completed child as merely idle — as if still available to chat.
The task tool now persists a terminal marker in the child session's
metadata (`deepagent.subagent.finished`) on every terminal path
(foreground + background, completed/error/cancelled). We mark rather
than archive: archived sessions are filtered out of the app store,
which would remove the child from the panel — but the requirement is
it stays listed and its full reasoning/output remain viewable. The
panel now renders a three-state status (running/finished/idle) and the
composer refuses new prompts on a finished child (read-only).
2. Subagent panel click → black screen. The click navigated to a bare
`/session/${id}`, missing the router's required `:dir` segment
(`/:dir/session/:id`), so no route matched and the panel rendered
blank. Now prefixes `params.dir`, matching every other nav call site.
3. question tool hardening. The parameter schema requires `options` to be
PRESENT but an empty array still decodes, and a zero-option choice
question is unanswerable — `ask` would block forever, hanging the turn.
execute() now returns a recoverable "rewrite your input" tool-result
(matching the plan-gate soft-feedback model) when questions is empty or
any question has no options. Adds regression tests.
Verified: typecheck 2/2, question + task + structured-output suites green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
… Code
New import subsystem (packages/deepagent-code/src/import) that reads a
Codex or Claude Code installation and replays its chat history, memory,
and skills into the live deepagent-code database, idempotently.
- Sources: parsers for Codex and Claude Code on-disk formats (source/).
- IR + mapper: normalize to a SourceSession IR, then map to the v2 event
stream so all projectors (session/message/session_message) populate via
the same path sync uses. Re-import converges without duplicates.
- Writers: session, memory, skill. Import projects are isolated under a
`proj_imp_` prefix so they never merge into a native git-remote project.
- Secret redaction pass on imported content (util/secrets).
- Surfaces:
* CLI `import-history` command.
* HTTP `/global/import` (SSE progress stream + ImportReport) and
`/global/projects` (list all project rows incl. not-yet-opened, so the
History view can show imported sessions).
* Settings "Import history" panel + History Projects dialog, reachable
from a new sidebar History entry.
- i18n strings for the above across all locales (also carries the
subagent finished/read-only strings from the prior commit).
Verified: typecheck 2/2; import subsystem tests 8/8; global HTTP tests green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- dialog-review: split knowledge items into pending vs approved memos with a select-all over pending, and factor rows into a Row component. Exposes the pending set the sidebar History badge consumes (listPending). - terminal: swallow two benign PTY errors instead of surfacing them as scary failures — "PTY session not found" (resize/title racing the PTY exit) and empty-body HTTP 503 (instance scope tearing down on project switch/reload). The terminal re-establishes on the new instance; on a benign error we restore the previous PTY entry rather than erroring out. Verified: typecheck 2/2. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Issue for this PR
Closes #
Type of change
What does this PR do?
Please provide a description of the issue, the changes you made to fix it, and why they work. It is expected that you understand why your changes work and if you do not understand why at least say as much so a maintainer knows how much to value the PR.
If you paste a large clearly AI generated description here your PR may be IGNORED or CLOSED!
How did you verify your code works?
Screenshots / recordings
If this is a UI change, please include a screenshot or recording.
Checklist
If you do not follow this template your PR will be automatically rejected.