Repository navigation
Add openStop AppFunction (opens a stop via PendingIntent) - #153
Merged
Merged
Conversation
The AppFunctions quality guidelines say a function that opens a screen should return an explicit, FLAG_IMMUTABLE PendingIntent for it. openStop gives assistants that for a stop's departures sheet. A name covering several stops is refused with their numbers, rather than guessing a side of the road. Ask GalwayBus leaves it out of its tools: nothing there sends the intent, so the model could claim to have opened a stop when nothing happened. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XcDRQnBoiM8GnCbW7b4Dts
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
openStop(stop)AppFunction, following the AppFunctions quality guidelines: returns the stop plusintentToOpen, an explicitFLAG_IMMUTABLEPendingIntentthat opens the stop's departures sheet. Takes a stop number, or a name only one stop has; a name covering several stops is refused with each stop's number and direction.OpenStopIntentbuilds and reads the intent. Each stop gets its own data URI, so earlier PendingIntents aren't redirected byFLAG_UPDATE_CURRENT.MainActivityhandles it on launch and inonNewIntent.App(stopToOpen, onStopOpened)passes it toGalwayBusViewModel.openStop(), which waits for the stop list and then opens the same sheet a map tap opens. iOS and desktop are unchanged, because the parameters default to nothing.AppFunctionAgentTools.discover()minusopenStop. Nothing in the app sends the intent, so the model could claim to have opened a stop.app_metadata.xmldescribesopenStop.Test plan
:androidApp:assembleDebug,:androidApp:testDebugUnitTest,:desktopApp:compileKotlin,:shared:compileKotlinIosSimulatorArm64,:shared:jvmTestopenStopwith a number returns the stop; with "Eyre Square" or "Galway Cathdrl", it returns an error listing the stops--pending-intent-path "property/androidAppfunctionsReturnValue.property/intentToOpen": the stop sheet opened from a cold start, and switched stop with the app already open (single activity instance)openStop, and still answers departures questions🤖 Generated with Claude Code
https://claude.ai/code/session_01XcDRQnBoiM8GnCbW7b4Dts