Skip to content

Give each agent thread its own running instance of the app - #168

Merged
SunkenInTime merged 1 commit into
mainfrom
agents-thread-instance
Sep 13, 2026
Merged

SunkenInTime merged 1 commit into
mainfrom
agents-thread-instance

Conversation

@SunkenInTime

Copy link
Copy Markdown
Owner

Same rule as #167 on the cloud branch, without the shared-session line since main has no accounts: each thread starts one instance of the app, keyed by worktree or branch name, with its own Hive store inside the app container and its own pid file; hot reloads it with SIGUSR1 after each edit; keeps it for the thread's life.

🤖 Generated with Claude Code

One bullet under the general rules: start one instance per thread, keyed
by worktree or branch, with its own Hive store inside the app container;
hot reload it with SIGUSR1 after each edit; keep it for the thread's life.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@SunkenInTime
SunkenInTime merged commit 777cb9c into main Sep 13, 2026
@greptile-apps

greptile-apps Bot commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

Do not merge the documented workflow unchanged because common branch names can prevent the instructed app instance from starting.

Findings

  1. P1 Slash-delimited keys break launch

Summary

  • This change documents a per-thread Flutter workflow with a separate Hive store and PID-based reload command. The Hive override was verified to select the requested store, and unusable store directories stop startup before Hive initializes. The documented PID-file command fails for normal slash-delimited branch names because Flutter does not create the implied parent directory, so the developer workflow needs a filename-safe key or an explicit directory-creation step before merge.

Reviews (1) · Last reviewed commit: "Give each agent thread its own running i..."

Comment thread AGENTS.md
These steer us in the right direction. They are not hard-set, but default to following them; if you think one should be ignored, be very loud about it and get approval from us first.

- Never edit `*.g.dart` files. Edit the source models, then run `dart run build_runner build --delete-conflicting-outputs`.
- Each thread owns one running instance of the app, and never touches another's. Start yours once, keyed by your worktree or branch name: `flutter run -d macos --pid-file /tmp/icarus-<key>.pid --dart-entrypoint-args "--hive-store-dir=<dir>"`, with `<dir>` = `~/Library/Containers/xyz.icarus-strats/Data/Library/Application Support/icarus-<key>` so its library is yours alone, launched from an unsandboxed shell or it draws but takes no clicks. Instances share a window frame, so move yours aside before you click. After every edit, hot reload it with `kill -USR1 $(cat /tmp/icarus-<key>.pid)`; the tool's stdin is not a terminal, so typing `r` does nothing. Keep it running for the thread, and kill it when the thread ends.

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.

P1 Slash-delimited keys break launch

<key> is defined as a worktree or branch name, so a typical value such as feature/isolated-run expands to /tmp/icarus-feature/isolated-run.pid. Flutter does not create /tmp/icarus-feature before writing the PID file, causing the documented launch to exit with PathNotFoundException before the app starts. Normalize the key for a filename or create the PID file's parent directory before invoking Flutter.

Context Used: AGENTS.md (source)

T-Rex Ran code and verified through T-Rex

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.

1 participant