Skip to content

W16AAPPLE-99: Remove the unused per-agent API key field - #80

Open
extraLaj wants to merge 314 commits into
openonion:mainfrom
extraLaj:w16a/79-W16AAPPLE-99
Open

extraLaj wants to merge 314 commits into
openonion:mainfrom
extraLaj:w16a/79-W16AAPPLE-99

Conversation

@extraLaj

Copy link
Copy Markdown

Part 79 of 91 in the W16A-APPLE (UNSW COMP3900) series, one PR per ticket, in the order the work was merged.

Order: Merge after #79. Until that is merged, this PR also shows the earlier parts. Please merge in order with Create a merge commit (not squash or rebase), so each later PR narrows to its own ticket.

This ticket only: w16a/78-W16AAPPLE-34...w16a/79-W16AAPPLE-99

Changes: 15 files changed, 54 insertions(+), 218 deletions(-)

Commits:

  • removed unused field and related code
  • Fixed review comments

🤖 Generated with Claude Code

ky7526 and others added 30 commits October 10, 2026 19:06
…erge' into 'main'

W16AAPPLE-22: Handle CONNECTED status and server_newer merge

Closes W16AAPPLE-22

See merge request coursework/comp3900/26t3/capstone-projects/3900-w16a-apple/project!18
Resolve W16AAPPLE-13 "Exec"

Closes W16AAPPLE-13

See merge request coursework/comp3900/26t3/capstone-projects/3900-w16a-apple/project!12
resolving sparse connectivity issues regarding reconnection

Closes W16AAPPLE-90

See merge request coursework/comp3900/26t3/capstone-projects/3900-w16a-apple/project!19
Resolve W16AAPPLE-20 "Oip conformance checklist"

Closes W16AAPPLE-20

See merge request coursework/comp3900/26t3/capstone-projects/3900-w16a-apple/project!22
Add RelayFailoverTest. It breaks the relay connection partway through a
reply and checks that the app reconnects through the relay, resumes the
same session from the last message it saw, and shows and saves the rest
of the reply exactly once. Cases covered:
- the connection drops without warning
- the relay restarts
- the relay is down for a few attempts, then comes back
- the relay is back before the agent's host
- the agent's host disconnects mid-reply
- the relay stays down past the retry limit, then the network comes back
- the reply finishes while the relay is down
- the relay closes normally (code 1000): the app waits for the user to
  reconnect, as the ConnectOnion web client does, then the reply resumes

The relay is faked in the test; how it rejects a connection was checked
against the real relay at oo.openonion.ai.

Move the fake host out of ProcessDeathResumeTest into
testing/FakeOipHost.kt so both tests share it, and add the new test to
the regression suite.

Known issue: when the agent's host disconnects mid-reply, an "agent
offline" message is left in the chat after the reply resumes
(W16AAPPLE-93).
Two tests failed in the pipeline but not locally:

- The app checks every 100 ms whether its connect call has reached
  Connected. On a slow runner the test broke the relay before that
  check ran, so the app treated it as a failed first attempt and opened
  a fresh connection on its own (a redial before the user asked, and a
  reconnect with no last_msg_id). The test now waits for the connect
  call to finish before breaking anything.
- The fake network was a StateFlow, so turning it off and straight back
  on could reach the app as a single "on", and it never retried. It is
  now a SharedFlow, so the app sees both changes.
Every frame used to reach the app while it was connected, so nothing
was ever replayed after a reconnect. In each recovery case the agent
now finishes its tool call while no socket is open, so the host only
buffers the tool_result. After the reconnect the test checks it is
forwarded once, over the new connection, and shows and is saved once,
before the rest of the reply is sent live.
W16AAPPLE-26: Automated relay-failover reconnection test

Closes W16AAPPLE-26

See merge request coursework/comp3900/26t3/capstone-projects/3900-w16a-apple/project!20
Resolved w16AAPPLE-18-Handle-SESSION_STATUS

See merge request coursework/comp3900/26t3/capstone-projects/3900-w16a-apple/project!21
When the Host drops off the relay mid-reply, the relay answers the
app's next frame with ERROR "Agent not connected" and drops the socket.
The app had already connected, so it treated this as a business error
on a live session and added "This agent is offline..." to the
conversation, where it stayed after the reconnect resumed the reply.

That ERROR on a live socket is now only logged. The drop that follows
already starts the reconnect, which is the status the user sees, and
the ConnectOnion web client never adds an ERROR to the conversation.
Other errors on a live session (e.g. insufficient credits) still are.

The RelayFailoverTest case is no longer a known issue.
ConnectToAgentUseCase judged a connect attempt by checking every 100 ms
whether the state was Connected. A connection that reached CONNECTED and
dropped before the next check was counted as failed, so the use case
reset the session and connected again on its own, without last_msg_id.
After a normal (code 1000) close it reconnected instead of waiting for
the user.

The repository already tracked whether this attempt reached CONNECTED.
It is now exposed as hasConnectedThisAttempt and is the verdict, so a
drop straight after connecting is left to the connection's own
reconnect.
W16AAPPLE-93: keep the relay's agent offline error out of the chat

Closes W16AAPPLE-93

See merge request coursework/comp3900/26t3/capstone-projects/3900-w16a-apple/project!25
W16AAPPLE-94: count an attempt that reached CONNECTED as connected

Closes W16AAPPLE-94

See merge request coursework/comp3900/26t3/capstone-projects/3900-w16a-apple/project!26
Added NetworkDropTest, which cuts the network mid-reply and checks the
app backs off, reconnects once it's back, and gets the missed frames
replayed with nothing doubled. Covers the socket failing straight away
and going silent until the ping times out.

Moved the setup shared with RelayFailoverTest into RelayResumeTestBase.
W16AAPPLE-25: test recovery from a dropped network

Closes W16AAPPLE-25

See merge request coursework/comp3900/26t3/capstone-projects/3900-w16a-apple/project!27
Henry and others added 29 commits November 9, 2026 20:00
Resolve W16AAPPLE-119: require Java 17+ in the local Android setup

Closes W16AAPPLE-119

See merge request coursework/comp3900/26t3/capstone-projects/3900-w16a-apple/project!74
W16AAPPLE-44: push notifications when waiting for approval

Closes W16AAPPLE-44

See merge request coursework/comp3900/26t3/capstone-projects/3900-w16a-apple/project!77
Resolve W16AAPPLE-78 "Deep link domain"

Closes W16AAPPLE-78

See merge request coursework/comp3900/26t3/capstone-projects/3900-w16a-apple/project!76
Resolve W16AAPPLE-111 "Qr straight to invite"

Closes W16AAPPLE-111

See merge request coursework/comp3900/26t3/capstone-projects/3900-w16a-apple/project!75
Resolve W16AAPPLE-98 "Direct agent address"

Closes W16AAPPLE-98

See merge request coursework/comp3900/26t3/capstone-projects/3900-w16a-apple/project!79
Resolve W16AAPPLE-89 "Conversation switch filing"

Closes W16AAPPLE-89

See merge request coursework/comp3900/26t3/capstone-projects/3900-w16a-apple/project!78
…ain'

Resolve W16AAPPLE-39 "Switch between agent and workroom"

Closes W16AAPPLE-39

See merge request coursework/comp3900/26t3/capstone-projects/3900-w16a-apple/project!80
Resolve W16AAPPLE-34 "Provider messages artifacts"

Closes W16AAPPLE-34

See merge request coursework/comp3900/26t3/capstone-projects/3900-w16a-apple/project!83
removed unused field and related code

See merge request coursework/comp3900/26t3/capstone-projects/3900-w16a-apple/project!81
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.

4 participants