Conversation
wgqqqqq
marked this pull request as ready for review
September 24, 2026 08:35
Expose the host's persistent Goal to Android, iOS, and HarmonyOS through a negotiated `thread_goal_v1` capability, so a phone can read, start, edit, pause, resume, or clear the goal of the session it is driving. - host: add `RemoteCommand::ThreadGoal` / `RemoteResponse::ThreadGoal` plus `RemoteGoalAction`, route them through `RemoteCommandRuntimeHost` with an explicit unsupported default, and implement them in the core runtime host. Goal operations resolve the session's own workspace binding and storage; no controller path participates. - host: abandon a held interrupted turn when a goal is started, edited, or resumed, otherwise the goal's steering turn stays queued behind recovery. Re-delivering the same active objective no longer resets usage. - shared: add the goal command/state contract, capability gating, stale-response fencing, and a foreground snapshot refresh. - android/ios/harmonyos: add the goal strip, `/goal` composer commands, and platform strings, with a HarmonyOS preview and focused tests. Co-authored-by: OpenBitFun <318544290+bitfun-ai@users.noreply.github.com>
…a checkpoint When a controller attaches to a Turn mid-run, its projected checkpoint only contains the rounds it observed. At completion the generation journal merge appended the earlier, unmatched rounds after the final answer, so every surface (desktop by array order, mobile by roundIndex) rendered the final reply before the Turn's first rounds. Insert unmatched rounds before the next matched round in generation order and renumber roundIndex accordingly.
…mobile goal actions from being dropped - move interrupted-turn abandon from remote_thread_goal into the coordinator, running only after a goal change commits and will steer the session - KMP/HarmonyOS: background goal refresh no longer shows busy; mutations queue behind in-flight mutations and supersede in-flight reads - add THREAD_GOAL_V1 to remote connect contract tests - tests for abandon ordering and mobile goal gating; drop unreachable close branch
wgqqqqq
force-pushed
the
codex/mobile-goal-support
branch
from
September 24, 2026 09:30
b26f0cb to
a60df87
Compare
… a session Copied turns kept the source runtime's recovery point and execution generation, so a branch whose last turn was interrupted held dispatch and could resume with the source context. Treat them as abandoned history.
… pause active goals - KMP: goal requests use their own generation instead of the session work generation, so loadMore/permission/model/stop-turn no longer cancel an in-flight goal change; they are dropped only on disconnect or session switch - host: remote pause requires an active goal (paused is idempotent), so a goal that completed meanwhile cannot be paused and revived through resume - test: unrelated session work does not drop an in-flight goal change
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.
Summary
Adds persistent thread goals to the remote-control clients, so the phone
that drives a desktop/CLI session can manage that session's Goal.
thread_goal/ response, an explicitRemoteGoalAction(read/start/edit/pause/resume/clear), a newthread_goal_v1capability, ahandle_goal_commandhost hook with anexplicit "unsupported" default, and the core runtime implementation.
new user message. Without this the goal's steering turn stays queued behind
interrupted-turn recovery forever.
fencing, and a foreground snapshot refresh.
/goalcomposercommands, platform strings, a HarmonyOS preview surface, and focused tests.
Fixes: no issue; reported/driven by the mobile goal work.
Type and Areas
Type: Feature
Areas: Rust core (
openbitfun-coreremote-connect runtime host,openbitfun-services-integrationswire protocol), mobile Android / iOS /HarmonyOS, shared Kotlin Multiplatform core.
Motivation / Impact
Goal support existed only on the desktop surface. A phone driving a remote host
could watch goal-driven turns but not start, edit, pause, resume, or clear the
goal itself.
workspace binding (including SSH bindings) and storage on the host. No
controller filesystem path participates in the operation.
thread_goal_v1are never probed with unknowncommands; clients show an upgrade message instead.
Verification
Run on this machine:
pnpm run fmt:rs— formatted the 4 changed Rust files, no residual diff.cargo test --locked -p openbitfun-services-integrations --no-default-features --features remote-connect --lib— 161 passed, 0 failed.cargo test --locked -p openbitfun-core --no-default-features --features agent-runtime,remote-connect,git --lib agentic::coordination::scheduler::tests— 60 passed, 0 failed.cargo test --locked -p openbitfun-core --no-default-features --features agent-runtime,remote-connect,git --lib service_agent_runtime::tests— 22 passed, 0 failed.node --test src/apps/mobile/harmonyos/tools/tests/thread-goal.test.cjs— 8 passed, 0 failed.pnpm run mobile:ui:check— contract and generated files in sync.pnpm run harmony:architecture— contracts satisfied.pnpm run theme:color-audit:all— 23 surfaces passed.Not run on this machine (toolchain absent):
:core-feature:jvmTestand Android:app:connectedDebugAndroidTest ... ThreadGoalPanelTest— no Java runtime.assembleHap— no hvigor / DevEco toolchain.Reviewer Notes
pnpm run mobile:architecturecurrently fails on four violations in files thisPR does not touch (
ClientBuildContractTest.ktreaching theharmonyostree,and default-arg public constructors in
AccountUiState.kt,RemoteSidebarPresentation.kt,ConversationModels.kt). I reproduced theidentical output from a pristine copy of
HEAD(git archive HEADofsrc/apps/mobileplus the checker), so it is pre-existing onmainand notintroduced here. The check is not wired into CI.
action/objectivefields deserialize asNone; a host withoutthread_goal_v1keeps the old behavior, and the new trait method has anexplicit unsupported default. The wire round-trip test covers both directions.
and budget-limited goals can be edited but not resumed.
isolation; neither replaces a live remote-host acceptance test.
Generated with OpenBitFun