Skip to content

feat(agent): multi-action requests (adopt stoa FinalIntent) - #47

Merged
flarexium merged 1 commit into
mainfrom
feat/multi-action-bookkeeper
Jun 12, 2026
Merged

feat(agent): multi-action requests (adopt stoa FinalIntent)#47
flarexium merged 1 commit into
mainfrom
feat/multi-action-bookkeeper

Conversation

@flarexium

Copy link
Copy Markdown
Contributor

Closes #43. Part of the multi-action epic (#45).

What

One bookkeeper request can now perform several actions — the canonical case is "reverse that entry and re-post it at the right amount" (a reverse_journal then a post_journal) in a single request.

  • Bump stoa → v1.0.9 (the FinalIntent loop).
  • bookkeeping.Intent gains a top-level final flag + IsFinal(). The model marks its last action final: true; the loop executes it and stops. A lone post is itself final, so the common single-action request is still one turn. The intent schema requires final; a "Completing a request" prompt block teaches when to set it.
  • All entry points are multi-action because Intent implements IsFinal — TUI, book-run, bench.
  • Bounds: MaxTurns defaults raised 3 → 8 (fits a correction: recall + reverse + lookup + final post); maxPostsPerRequest (=12) caps postings against a runaway loop independently of the turn budget.

Not yet atomic

Each action publishes as it executes, so a request that fails after its first action leaves that action committed. bookkeeping.Staging (already merged, #42) is the mechanism to make the batch all-or-nothing; wiring it into the agent is the follow-up (#44). Called out in AGENTS.md and docs/architecture.md.

Tests

  • TestAgent_MultiActionReverseThenRepostInOneRequest — one Book does reverse (not final) then post (final); 2 turns, 3 entries (original + reversal + correction).
  • TestPromptRenderer_TeachesFinalAction — the completion rule is in the prompt.
  • Existing fakes updated to mark their single action final (otherwise multi-action loops to MaxTurns).

go build/vet/test ./... green; gofmt clean.

🤖 Generated with Claude Code

…caps

Adopt stoa v1.0.9's FinalIntent so one bookkeeper request can perform several
actions (e.g. reverse a wrong entry then re-post the correction):

- bookkeeping.Intent gains a top-level `final` flag and IsFinal(); the model
  marks its last action final and the loop executes it then stops. A lone post
  is itself final, so the common single-action request stays one turn. The
  intent schema requires `final`; the prompt teaches when to set it.
- Every entry point is multi-action (Intent implements IsFinal): TUI, book-run,
  and bench. MaxTurns defaults raised 3 -> 8 to fit a correction (recall +
  reverse + lookup + final post); maxPostsPerRequest caps postings against a
  runaway loop independently of the turn budget.

Multi-action requests are not yet atomic (each action publishes as it runs);
bookkeeping.Staging will make the batch all-or-nothing in the follow-up.

Tests: multi-action reverse-then-repost in one Book; prompt teaches the final
action; existing fakes mark their single action final. Docs in the same change.

Closes #43.

@mirror520 mirror520 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@flarexium
flarexium merged commit c16649f into main Jun 12, 2026
1 check passed
@flarexium
flarexium deleted the feat/multi-action-bookkeeper branch June 12, 2026 06:47
flarexium added a commit that referenced this pull request Jun 12, 2026
…caps (#47)

Adopt stoa v1.0.9's FinalIntent so one bookkeeper request can perform several
actions (e.g. reverse a wrong entry then re-post the correction):

- bookkeeping.Intent gains a top-level `final` flag and IsFinal(); the model
  marks its last action final and the loop executes it then stops. A lone post
  is itself final, so the common single-action request stays one turn. The
  intent schema requires `final`; the prompt teaches when to set it.
- Every entry point is multi-action (Intent implements IsFinal): TUI, book-run,
  and bench. MaxTurns defaults raised 3 -> 8 to fit a correction (recall +
  reverse + lookup + final post); maxPostsPerRequest caps postings against a
  runaway loop independently of the turn budget.

Multi-action requests are not yet atomic (each action publishes as it runs);
bookkeeping.Staging will make the batch all-or-nothing in the follow-up.

Tests: multi-action reverse-then-repost in one Book; prompt teaches the final
action; existing fakes mark their single action final. Docs in the same change.

Closes #43.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Adopt the multi-action loop (stoa): MaxTurns, prompt rules, runaway cap

2 participants