Repository navigation
fix(antigravity): show queued sends and add a shared agent rules editor - #448
Open
yuga-hashimoto wants to merge 4 commits into
Open
yuga-hashimoto wants to merge 4 commits into
yuga-hashimoto wants to merge 4 commits into
Conversation
Antigravity runs each turn as a one-shot process, so a send while it is running is queued rather than interrupting. That path dropped the message from the screen entirely, which read as if the send had been swallowed. Draw the bubble when it is queued and send it without adding a second copy when the queue drains.\n\nAlso: open a chat whose run is still in flight as running, so a send there queues behind it instead of killing the process; keep a navigated-away run's drawer spinner until the runtime reports its own idle; and wire the send-behavior setting into the chat, which had been read only at its default.
The common AndCode context is written into each agent's native instruction file, but there was no way to see or extend it from the app and Codex was not covered at all. Add root/.codex/AGENTS.md to the installed targets, and add a Settings screen that shows the bundled context and stores the user's own addition. The addition is appended once and written to OpenCode, Claude Code, Antigravity and Codex together on the next runtime start.
- Pass isSessionRunning through the Koin ChatViewModel binding too, so both construction paths stay in step.\n- Do not re-add a drained queued bubble if the connection dropped and the send fell into the offline branch.\n- Correct the Antigravity kill comment now that a same-session supersede no longer kills the process.
…and-interject # Conflicts: # app/src/main/java/com/yugahashimoto/andcode/runtime/local/AntigravityRuntime.kt
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
sendBehavior == "queue"またはforcesQueueのランタイム)。あわせて、これまで Chat に渡っていなかったsendBehavior設定を配線。isRunningが false になり、次の送信が「割り込み」としてagyのプロセスを殺していた問題を修正(実行中ならキューに回す)。AntigravityRuntime.sendを per-session lock に変更。同一チャットの次の送信は前のターン完了まで待ち、別チャットは並行のまま。root/.codex/AGENTS.md) を追加。検証
この環境ではビルド/テストを実行しない方針(JIT が使えず Gradle が極端に遅い)のため、ローカルゲートは未実行です。CI にビルドとテストを任せます。
ChatViewModelTestの新規3件は変更前にローカルで通過済みです。origin/main を取り込み済みです。Pre-PR review
判定: APPROVE
ブロッカー
なし
提案(非ブロッキング)
AntigravityRuntime.kt:79—sessionLocksはセッションごとに ReentrantLock を保持したまま削除されません。チャット数に比例する程度の軽微なリークです(実害は小)。気になるならwithSessionLockの finally で、待機者/保有者がいないときだけsessionLocks.remove(sessionId, lock)する余地はありますが、必須ではありません。AntigravityRuntime.kt:620-634— 新しい per-session 直列化にはユニットテストがありません(send()は PRoot 実プロセス依存で単体化が難しいため妥当)。挙動はチャット層のキュー系テストで間接的に守られていますが、可能なら抽象化した lock ヘルパのテストがあると安心です。retainUserTextsの id 化、bundled のオフスレッド読み込み)は引き続き非ブロッキングです。チェック済み項目
origin/main=a960fad2(PR fix(antigravity): run multiple sessions in parallel #446/feat(drawer): show each chat's pull request state in the sidebar #447 取り込み後)。origin/main..fix/antigravity-busy-and-interject=93b8bedb(merge)/9de1fb15/b78f0baa/5c3b24e6。コンフリクトはAntigravityRuntime.ktのみで、他は自動マージ。git show/git diff origin/mainで解決後の全体を確認。AntigravityProcessGateは main 版と完全一致(serialize/SEND_MAX_WAIT_MSは存在せず、exclusive/acquireThenRelease/withoutPipe/readWithTimeoutのみ)。ブランチ側にserialize参照は残っておらず、他ファイルも main のまま(grep で確認)。コンパイル破綻なし。send()全体をwithSessionLock(sessionId)で包み、effectiveConversationId(:253)とprepareAntigravityPrompt(:258)をロック取得後に計算。別セッションは各自のロック+短い起動グレース(acquireThenRelease:284, 2.5s)だけを共有し並行可。kill しない方針と一致。abortはセッションロックを取らないため lock 順序の逆転なし。withSessionLockはprivate inline(private メンバsessionLocksを参照可)で、return@runCatching(:405/:412)は inline 展開により内側のプロセス後始末 finally→ロック解放 finally の順で確実に通る(tryLock 失敗時は try に入る前に throw するので二重 unlock なし)。別セッション同時送信でも詰まらない。try/finally(:419-425 のprocesses.remove(sessionId, process)+terminate)がロック解放より先に走るため、同一セッションの次送信がprocesses登録を上書きした後に前ターンが誤って消す競合は起きない。processes[sessionId]はスタートアップグレース前(:309)に登録され、abort/abortAllがグレース中も停止可能。acquireThenReleaseが null(ゲート60s待ち)のときはプロセス未起動でerror(...)→runCatchingの onFailure が SessionError+SessionIdle を emit。プロセスリークなし。retainUserTexts全10箇所、fromQueue3分岐(offline :1535 / queue :1569 / normal :1580 いずれもif (fromQueue))、isSessionRunning(本体 :684/:1134、KoinViewModelModule.kt:31)が健在。マージで欠落なし。kotlinOptionsにallWarningsAsErrorsは無く、turnError未読(main 由来の既存)等の警告でビルドは落ちない。java.util.concurrent.locks.ReentrantLock/TimeUnitは完全修飾で import 不要、ConcurrentHashMapは既存 import 済み。