Skip to content

AGY checkpoint can drop post-tool obligations before final response #251

Description

@GSL-R

Summary

When using agy as the active provider, long or tool-heavy turns can pass through an additional AGY checkpoint/compaction layer. After that checkpoint, the model may still complete the immediate tool task, but it can drop post-tool obligations that cli-jaw injected in the system prompt / pre-prompt hook, such as recording durable system events before the final response.

This looks different from ordinary context loss: the current user task is still understood and executed, but the final response is produced without re-checking the obligations that were supposed to apply after tool execution.

Observed behavior

A recent turn looked like this:

  1. User reported that an LXC disk resize/restart was complete and asked the agent to verify the state.
  2. cli-jaw spawned agy with the current prompt and pre-prompt runtime context.
  3. The agent ran verification commands such as df -h / and pm2 list.
  4. AGY emitted an internal checkpoint/compaction event in the transcript between tool calls and the final answer.
  5. The agent correctly answered that the filesystem and jaw-server were healthy.
  6. However, it did not run the diary/recording procedure even though the turn contained durable system-state verification and should have triggered the configured record gate.

In other words, the tool work succeeded, but the post-action obligation was lost after the AGY checkpoint.

Why this matters

For long-running companion/operations agents, post-tool obligations are important:

  • record durable system changes or incident recovery
  • update state files after verification
  • avoid saying a task is complete before persistence checks are done
  • emit [SILENT] or a user-visible heartbeat response according to heartbeat policy

With agy, cli-jaw appears to act more like a mediator/toolbox around an external AGY session. AGY also maintains its own transcript/checkpoint state, so cli-jaw's prompt assembly and AGY's internal compaction are not always aligned.

This makes lightweight models particularly vulnerable: they may perform the immediate task but forget the final post-tool checklist.

Expected behavior

After tool execution and before final answer delivery, cli-jaw should have a provider-level way to reassert short post-action obligations, especially for AGY print-mode sessions.

Examples:

  • append a small final reminder before response synthesis / delivery
  • re-inject a concise post-tool hook after AGY checkpoint/resume boundaries
  • expose a provider hook such as beforeFinalResponse / postToolReminder
  • preserve and reassert obligations from the pre-prompt hook after compaction-like transcript events

Local mitigation that helped

We added a short pre-prompt runtime reminder, for example:

Before the final response, re-check this turn's tool results. File/package/settings/automation changes, incident recovery, df/pm2/service-state verification, and user operational decisions are recording triggers. If matched, run the diary-recording procedure before answering.

This helps on fresh turns, but it is still only pre-prompt context. If AGY checkpoints between tool execution and final response, a post-tool/final-response hook would be more reliable.

Related notes

This is related to earlier AGY integration edge cases where cli-jaw successfully passed context at spawn time, but AGY's own session/checkpoint layer changed what remained salient later in the turn. It is not necessarily an AGY bug alone; it is an integration boundary issue between cli-jaw prompt assembly and AGY's internal session lifecycle.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions