Skip to content

Fixed App permissions to BLE and Notifications - #42

Merged
akshaynarisetti merged 2 commits into
mainfrom
permission-patch
Apr 12, 2024
Merged

akshaynarisetti merged 2 commits into
mainfrom
permission-patch

Conversation

@akshaynarisetti

Copy link
Copy Markdown
Contributor

Fixes #41

@akshaynarisetti
akshaynarisetti merged commit ad505c3 into main Apr 12, 2024
@akshaynarisetti
akshaynarisetti deleted the permission-patch branch April 12, 2024 05:34
Glucksberg pushed a commit to Glucksberg/omi-local that referenced this pull request Apr 28, 2026
aryanorastar pushed a commit to aryanorastar/omi that referenced this pull request Jul 22, 2026
feat(windows/track3): AI User Profile service (proactive enabler)
aryanorastar pushed a commit to aryanorastar/omi that referenced this pull request Jul 22, 2026
aryanorastar pushed a commit to aryanorastar/omi that referenced this pull request Jul 22, 2026
…sion relay

The main-process AI-profile service (merged in BasedHardware#42) could generate a profile but
nothing ever gave it a session, so it was inert. The Firebase token lives only in
the renderer, so the renderer now relays a session to main.

Design: main owns the cadence, the renderer is a dumb relay. The renderer cannot
see generatedAt (aiProfileGetLatest returns only the profile TEXT), and
onIdTokenChanged fires ~hourly on token refresh -- so a renderer-side
'generateNow' would regenerate hourly. Instead configureAiProfileSession() runs
the due-check on every session push, gated by the real shouldGenerate(). That
also closes the startup race: maybeGenerateOnStartup() runs before sign-in,
defers, and previously nothing re-checked for up to 6h.

Sign-out safety (the two bugs an audit caught, both reachable only because this
change makes generation fire at sign-in):
- An in-flight generation used to complete after signOutUser()'s DELETE FROM
  ai_user_profiles and write the signed-out user's synthesized dossier back into
  the wiped DB -- and into the next account's DB if they signed in during the
  window. Now a monotonic sessionEpoch (bumped on every session change including
  null) is pinned at generation entry and re-checked immediately before both the
  insert and the backend sync, plus an AbortController kills the in-flight HTTP.
- A slow getIdToken() could resolve after sign-out and re-arm main with the old
  user's session. The host now drops a push whose auth sequence is stale.

Also: a failing generation never advances generatedAt, so it stayed 'due' and
retried on every hourly refresh (~24 LLM calls/day instead of 4). Added a 6h
attempt floor consumed at the start of every attempt regardless of outcome.

aiProfileEnabled now defaults OFF: nothing consumes the profile yet (the Focus
assistant's context block is the consumer) and there is no Settings toggle, so a
default-on daily two-stage LLM call that uploads a personal dossier would cost
the user with no benefit and no off-switch. The PR that adds the consumer flips it.

Verification:
- pnpm typecheck clean (node + web); pnpm lint 0 errors on touched files.
- Full suite: 212 files / 1661 tests passed, 0 failed (+18 new).
- The cadence claim is pinned against the REAL shouldGenerate, not a stubbed
  constant: 'a full day of hourly token refreshes against a fresh profile yields
  ZERO generations' composes the real 24h interval with the real trigger path.
- C1 covered end-to-end against the real orchestrator (session changes
  mid-generation -> insertProfile and syncProfile never called) and by asserting
  the AbortSignal handed to net.fetch actually flips to aborted on sign-out.
kodjima33 pushed a commit that referenced this pull request Sep 15, 2026
)

- Add coerce_issue_number/coerce_limit helpers so issue_number values like
  '#42' or ' 42 ' and limit values arriving as JSON null/strings are
  normalized into clean validation errors instead of raising ValueError/
  TypeError inside tool_get_issue, tool_add_comment, and tool_list_issues.
- github_client.list_issues/get_issue now return explicit error structures
  ({'error', 'status'}) instead of collapsing non-200 responses into
  []/None, and handlers propagate them to ChatToolResponse(error=...).
- list_issues fetches per-page headroom and follows next links (bounded)
  so pull requests sharing the issues endpoint cannot starve the
  requested limit.
- test_agent now surfaces get_repo_permissions _error payloads instead of
  masking them as a missing-write-access denial.

Verified: python3 plugins/omi-github-app/test_main.py (24 tests, OK;
20 of 24 fail against the unpatched sources); existing
test_github_client.py still passes; run_checks --check-id
github-app-coerce-tests passes.

Failure-Class: none

Co-authored-by: devin <[email protected]>
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.

Permissions on app are altered

1 participant