What happened?
Magic Context internal agent sessions such as historian, historian-editor, dreamer, and sidekick are closed/deleted almost immediately after they run.
In practice, when one of these agents starts, its session/pane may appear only for a moment and then disappear before the user can inspect what happened. This makes it hard to debug failed or partial historian/dreamer runs, inspect the produced output, or understand why an internal agent did not behave as expected.
This is especially visible now that internal agents are surfaced like normal OpenCode subagent sessions while they are running: the session briefly opens, Magic Context reads the output, and then the child session is deleted right away.
Expected behavior
Internal Magic Context agent sessions should remain inspectable after they complete, at least long enough for the user to review the transcript/output when needed.
The important part is not to keep them running forever, but to avoid deleting the child session immediately after Magic Context has read its result. These agents produce useful diagnostic context, and immediate deletion removes the ability to inspect that context from the UI/session history.
Actual behavior
The internal agent session is created, prompted, Magic Context reads the result, and then the child session is deleted immediately. Visually this looks like the historian/dreamer/sidekick pane flashes open and closes almost instantly.
Why this seems to happen
From the observed behavior, Magic Context appears to treat these child sessions as temporary implementation details: create child session -> run prompt -> read output -> delete/cleanup in the same lifecycle.
That makes sense for hidden background bookkeeping, but it becomes problematic when these child sessions are visible/inspectable as agent sessions. The lifecycle is too aggressive for debugging and transparency: by the time the user notices the agent ran, the session may already be gone.
Affected agents
historian
historian-editor
dreamer
sidekick
There may be other internal Magic Context agents using the same lifecycle.
Impact
- Hard to inspect historian/dreamer output after a run.
- Hard to debug failed or unexpectedly short internal-agent executions.
- The UI appears to flicker because the child session is removed immediately.
- Users lose useful diagnostic history for Magic Context automation.
Environment
- Magic Context: 0.20.0
- OpenCode: 1.15.x
Notes
I am not suggesting a specific code-level fix here. The main issue is the Magic Context lifecycle for internal child agent sessions: they should not be deleted immediately after their output is read if they are intended to be inspectable/debuggable like other agent sessions.
What happened?
Magic Context internal agent sessions such as
historian,historian-editor,dreamer, andsidekickare closed/deleted almost immediately after they run.In practice, when one of these agents starts, its session/pane may appear only for a moment and then disappear before the user can inspect what happened. This makes it hard to debug failed or partial historian/dreamer runs, inspect the produced output, or understand why an internal agent did not behave as expected.
This is especially visible now that internal agents are surfaced like normal OpenCode subagent sessions while they are running: the session briefly opens, Magic Context reads the output, and then the child session is deleted right away.
Expected behavior
Internal Magic Context agent sessions should remain inspectable after they complete, at least long enough for the user to review the transcript/output when needed.
The important part is not to keep them running forever, but to avoid deleting the child session immediately after Magic Context has read its result. These agents produce useful diagnostic context, and immediate deletion removes the ability to inspect that context from the UI/session history.
Actual behavior
The internal agent session is created, prompted, Magic Context reads the result, and then the child session is deleted immediately. Visually this looks like the historian/dreamer/sidekick pane flashes open and closes almost instantly.
Why this seems to happen
From the observed behavior, Magic Context appears to treat these child sessions as temporary implementation details: create child session -> run prompt -> read output -> delete/cleanup in the same lifecycle.
That makes sense for hidden background bookkeeping, but it becomes problematic when these child sessions are visible/inspectable as agent sessions. The lifecycle is too aggressive for debugging and transparency: by the time the user notices the agent ran, the session may already be gone.
Affected agents
historianhistorian-editordreamersidekickThere may be other internal Magic Context agents using the same lifecycle.
Impact
Environment
Notes
I am not suggesting a specific code-level fix here. The main issue is the Magic Context lifecycle for internal child agent sessions: they should not be deleted immediately after their output is read if they are intended to be inspectable/debuggable like other agent sessions.