Skip to content

Add HTTP client documentation for Astrology API integration#7

Merged
DHCross merged 2 commits intomainfrom
copilot/use-astrology-api-example
Dec 24, 2025
Merged

Add HTTP client documentation for Astrology API integration#7
DHCross merged 2 commits intomainfrom
copilot/use-astrology-api-example

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Dec 24, 2025

User asked which HTTP client to use for the Astrology API (HTTP/Unirest/Axios/Fetch). The codebase already uses native fetch consistently.

Changes

  • Added vessel/docs/ASTROLOGY_API_CLIENT.md documenting:
    • Recommendation: Use native fetch API (already established pattern)
    • Client-side examples via the existing /api/astrology proxy route
    • Server-side direct API call patterns
    • Environment variable configuration (RAPIDAPI_KEY with Astrology_API_KEY fallback)
    • Conversion guide from Node.js HTTP module to fetch

Example

The verbose Node.js HTTP code converts to:

const response = await fetch(
    `https://${apiHost}/api/v3/glossary/houses?house_system=P`,
    {
        method: 'GET',
        headers: {
            'x-rapidapi-key': apiKey,
            'x-rapidapi-host': apiHost
        }
    }
);
const data = await response.json();
Original prompt

I wanted to use this Astrology API feature, what would be the best "client" type to use? HTTP
Request
Unirest
Axios
Fetch ? For this: const http = require('https');

const options = {
method: 'GET',
hostname: 'best-astrology-api-natal-charts-transits-synastry.p.rapidapi.com',
port: null,
path: '/api/v3/glossary/houses?house_system=P',
headers: {
'x-rapidapi-key': '40889e2cf0msh5573bf5995e3376p19ffcfjsn815e8406eee3',
'x-rapidapi-host': 'best-astrology-api-natal-charts-transits-synastry.p.rapidapi.com'
}
};

const req = http.request(options, function (res) {
const chunks = [];

res.on('data', function (chunk) {
chunks.push(chunk);
});

res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});

req.end();


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@vercel
Copy link
Copy Markdown

vercel Bot commented Dec 24, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
shipyard Ready Ready Preview, Comment Dec 24, 2025 6:04pm

Co-authored-by: DHCross <45954119+DHCross@users.noreply.github.com>
Copilot AI changed the title [WIP] Add example for using Astrology API with HTTP client Add HTTP client documentation for Astrology API integration Dec 24, 2025
Copilot AI requested a review from DHCross December 24, 2025 18:04
@DHCross DHCross marked this pull request as ready for review December 24, 2025 18:04
@DHCross DHCross merged commit d87d741 into main Dec 24, 2025
2 checks passed
@DHCross DHCross deleted the copilot/use-astrology-api-example branch December 24, 2025 18:04
DHCross added a commit that referenced this pull request Mar 2, 2026
…ge clarity

HIGH priority:
- #6 symbolicWeather: soft-fail instead of re-throwing AuthorityViolationError
- #7 TTS: add 10s AbortController timeout to ElevenLabs fetch (504 on timeout)
- #9 injectProtocols: wrap in try/catch, continue without corpus on failure

MEDIUM priority:
- #2 LLM auth: normalize 401/403 to user-friendly message
- #3 LLM timeout: add one retry in generateReplyWithRetry
- #4 Empty LLM response: distinguish content_filter from true empty
- #5 AuthorityViolation outer catch: hide internal module names

LOW priority:
- #1 Missing LLM key 503: clearer operator message
- #8 useOracleChat: map 413 to user-friendly 'message too long' text
- #10 Remove void-cast needsConcreteRetry/needsProtocolRepair calls
DHCross pushed a commit that referenced this pull request Apr 25, 2026
Original task (Task #7): All unit tests under
`vessel/src/app/api/raven-chat/__tests__/` pass typecheck but were never
executed by `npm test` — only `recoveryMessages.test.ts` was wired into
the `test:smoke` script.

Change:
- `vessel/package.json`: extended the `test:smoke` script to include all
  13 previously-unwired `raven-chat/__tests__/*.test.ts` files alongside
  the existing `recoveryMessages.test.ts`. Files added (alphabetical):
  circumstanceDisclosure, counterpartProvenance, enrichmentPhase,
  forecastIntent, generationIntegrity, intentDetection, promptLines,
  protocolRules, relationalPrep, requestParsing, sessionStateGuards,
  slashCommandDispatcher, turnContextResolver, userBlockBuilder.

Notes / deviations from the task brief:
- The task description listed `entityGuard` as one of the test files,
  but no `entityGuard.test.ts` exists in the directory. There are 14
  files total (1 already wired + 13 newly wired). Treated as a typo in
  the brief; nothing to wire that doesn't exist.
- Acceptance criterion "npm test exits 0 with all those tests passing"
  is NOT met. The pre-existing `test:smoke` baseline already had 26
  failing tests in unrelated suites (planner, blueprint-firewall,
  instrument-ledger, etc.) so `npm test` was already non-zero before
  this change. After wiring, totals are 367 tests / 339 pass / 28 fail
  (was 281/255/26). The 2 newly-surfaced failures are real
  implementation gaps in the production code that the test files were
  asserting against, not wiring problems:
    1. enrichmentPhase.test.ts — "runEnrichmentPhase reuses cached field
       report artifacts when no explicit two-clock request is present":
       `isTwoClockFetchRequest('read the symbolic moment for today')`
       returns true, so a two-clock fetch fires when the test expects
       it to be skipped.
    2. promptLines.test.ts — "field report contract includes
       FIELD→MAP→VOICE→VALIDATION canon order": the literal "CANON
       ORDER:" line is not present in `promptLines.ts` field-report
       rules.
  Both look like red TDD specs for product work that hasn't landed
  yet, consistent with the 26 other red specs already in the suite.
  Filed as a follow-up rather than fixed inline to keep this task
  scoped to wiring.

Replit-Task-Id: df2cf8ba-5edd-4664-abd8-8b8d1996aeb0
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.

2 participants