Minor Changes
- f954f59: Add
needs_planningclassification tostart_tasktool. The agent still callsstart_taskfor every message (preserving discipline), but now setsneeds_planning: falsefor simple messages like greetings and knowledge questions. When false, the adapter skips plan card emission and todo creation, and the completion enforcer treats it as a conversational turn — no continuation prompts needed.
Patch Changes
-
68094c9: refactor(agent-core): remove stale duplicate files from opencode/ directory
Deleted 6 dead files left behind after the encapsulation refactor: opencode/task-manager.ts,
opencode/adapter.ts, opencode/stream-parser.ts, opencode/log-watcher.ts, opencode/index.ts
(barrel), and internal/classes/CompletionEnforcer.ts. The canonical implementations live in
internal/classes/ and are used via the factory pattern. Re-pointed test imports to the active
internal/classes/ sources. No behavior changes; public API unchanged. -
0c555bf: fix(agent-core): serialize non-string error values in TaskResult to prevent downstream TypeError
The stream parser casts JSON.parse output to OpenCodeMessage without runtime validation. When the
OpenCode CLI emits an error message with a non-string error field (e.g. an object like
{name: "APIError", data: {...}}), the raw object was passed through to TaskResult.error which is
typed asstring | undefined. Downstream consumers calling.toLowerCase()on this value would
crash withTypeError: errorName.toLowerCase is not a function.Added defensive coercion in the adapter's error handling path: string values pass through unchanged,
non-string values are serialized via JSON.stringify to preserve error details.