Agilquest Reservations
Headless browser automation for Agilquest workspace reservation portal using Playwright. Handles Entra SSO authentication (cached for days) and retrieves reservation data.
Prerequisites
- Google Chrome or Chromium installed
uvpackage manager:pip install uvorbrew install uv- One-time auth setup completed (Step 0)
- Entra SSO access to Agilquest
Chrome version
The scripts launch the real, installed system Chrome by default (via
CHROME_PATH, falling back to platform defaults below) — NOT
Playwright's own bundled Chromium. This is a deliberate reversal of an
earlier fix; both directions have a real, confirmed failure mode, so
read both before changing this:
- System Chrome auto-updates on its own schedule, completely outside
Playwright's control or this project's
uv.lock. Letting it drift ahead of the specific Chromium build the installedplaywrightpackage was tested against causes CDP-protocol-level failures that look exactly like a network hang (confirmed live: real Chrome silently updated to 153.0.8010.36 againstplaywright==1.62.0's expected 151.0.7922.34, causing every launcher navigation to stall ~30s inside Chrome's redirect-delegate hook despite the server responding in under 300ms). - Playwright's bundled Chromium is unsigned and, on this
machine, intermittently killed mid-session by Microsoft Defender for
Endpoint's real-time protection (
[managed]— not disable-able locally) racing its startup — confirmed live killing a headedsetup_auth.pysession mid-interactive-MFA, twice, with no formal threat detection or quarantine logged (mdatp threat list: none; explicitmdatp scan custom: 0/327 threats). Real Chrome is already signed and trusted, so it never hits this race.
Full evidence trail for both: features/auth_and_session.md,
"Chrome/Playwright version drift" (bug #5) and its reversal note, and
get_chrome_path()'s docstring in lib/browser.py.
Set CHROME_PATH to override with a specific executable — e.g.
Playwright's bundled Chromium, to reproduce the version-drift bug on
purpose, or a Chrome channel not covered by the platform defaults:
# macOS
export CHROME_PATH="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
# Linux
export CHROME_PATH="/usr/bin/google-chrome"
# Or set permanently in ~/.config/agent-skills/agilquest-reservations.env:
# CHROME_PATH=/Applications/Google Chrome.app/Contents/MacOS/Google Chrome
Browser session stored at: ~/.local/state/agent-skills/agilquest-reservations/user_data/
(persistent; do not delete)
Last scraped reservations table is cached at:
~/.local/state/agent-skills/agilquest-reservations/reservations_cache.json
(written automatically by every live fetch; read by aq status)
aq CLI
The scripts are packaged as an installable aq command for day-to-day use.
Install (one-time)
cd skills/agilquest-reservations/scripts
uv tool install --editable .
This puts aq on your PATH (~/.local/bin/aq via uv tool). Because it's
an editable install, pulling changes to this skill takes effect immediately —
no reinstall needed.
Commands
aq checkin # Check in to today's reservation, then book +7 days if missing
aq book # Book +7 days ahead (same booking step, standalone)
aq book 2026-09-16 # Book a specific date
aq book +3 # Book 3 days from today
aq status # Today's status + 14-day calendar — offline, reads the cache only
aq status --days 30 # Wider calendar window
aq setup-auth # Interactive SSO login (one-time, or when sessions expire)
Run aq <command> --help for full options (--assets, --start, --end, --prestage).
aq status never launches Chrome — it's instant (well under a second) and reads
whatever aq checkin / aq book / any other fetch last wrote to the cache. Run one
of those first to populate it; after that aq status is safe to call as often as
you like (e.g. in a shell prompt or status bar).
Step 0: Setup Auth (one-time)
Establish persistent browser session with Entra SSO:
aq setup-auth
# or, without installing aq:
cd skills/agilquest-reservations/scripts && uv run src/agilquest_reservations/setup_auth.py
A Chrome window opens to https://login.agilquest.com/myreservations. Sign in via Entra SSO manually.
The session is cached and reused for all future headless runs.
Step 1: Check Active Reservations
Basic check
cd skills/agilquest-reservations/scripts && uv run src/agilquest_reservations/get_reservations.py
Check specific workspace (asset 343)
uv run src/agilquest_reservations/get_reservations.py --asset-id 343
Output format
JSON array of active reservations:
[
{
"id": "RES-12345",
"workspace": "Desk 4B",
"asset_id": 343,
"date": "2026-05-10",
"time": "09:00 - 17:00",
"status": "active"
}
]
Step 1b: Check In + Book Ahead
Checks in to today's reservation (if awaiting check-in) and ensures a
reservation exists 7 days ahead, booking it via the same asset-fallback
logic as aq book if missing:
aq checkin
# or:
cd skills/agilquest-reservations/scripts && uv run src/agilquest_reservations/checkin_and_book.py
Options: --skip-checkin, --skip-book, --assets, --start, --end
(see script docstring). Not currently scheduled via cron — run manually or
wire up with /schedule if daily automation is wanted.
Step 2: Schedule Recurring Checks
Use the schedule skill to run on a cron schedule:
/schedule agilquest-check "0 9 * * *"
This checks reservations every day at 9 AM and returns the JSON output.
Capabilities
| Operation | Command |
|---|---|
| Check all reservations | uv run src/agilquest_reservations/get_reservations.py |
| Check specific asset | uv run src/agilquest_reservations/get_reservations.py --asset-id 343 |
| Check in + book ahead | aq checkin |
| Book a date | aq book [DATE] |
| Status + calendar (offline) | aq status |
| Setup auth | aq setup-auth |
Environment variables
CHROME_PATH— Path to Chrome/Chromium executableAGILQUEST_ASSET_ID— Default workspace asset ID (optional)